Skip to content

Commit

Permalink
ci: automatically use the latest tag for install R regression tests (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
eitsupi authored May 1, 2024
1 parent 4871839 commit d29f05f
Showing 1 changed file with 26 additions and 16 deletions.
42 changes: 26 additions & 16 deletions .github/workflows/r-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- master
paths:
- .github/workflows/r-build-test.yml
- scripts/install_R_source.sh
- scripts/setup_R.sh
- scripts/bin/**
Expand All @@ -22,10 +23,9 @@ jobs:
strategy:
fail-fast: true
matrix:
# TODO: use the latest tag automatically
tag:
- "devel"
- "4.3.3"
- "latest"
platforms:
- linux/amd64
steps:
Expand All @@ -36,18 +36,23 @@ jobs:
uses: crazy-max/ghaction-github-runtime@v3
- name: test build
run: |
if [ "${{ matrix.tag }}" == "latest" ]; then
TAG="$(jq '.r_version[0]' -r build/matrix/latest.json)"
else
TAG="${{ matrix.tag }}"
fi
docker buildx bake \
-f bakefiles/"${{ matrix.tag }}".docker-bake.json \
-f bakefiles/"${TAG}".docker-bake.json \
--set=*.platform="${{ matrix.platforms }}" \
--set=*.cache-from=docker.io/rocker/r-ver:"${{ matrix.tag }}" \
--set=*.cache-from=type=gha,scope=r-ver-"${{ matrix.tag }}" \
--set=*.cache-to=type=gha,scope=r-ver-"${{ matrix.tag }}" \
--set=r-ver.tags=r-ver-test-"${{ matrix.tag }}" \
--set=*.cache-from=docker.io/rocker/r-ver:"${TAG}" \
--set=*.cache-from=type=gha,scope=r-ver-"${TAG}" \
--set=*.cache-to=type=gha,scope=r-ver-"${TAG}" \
--set=r-ver.tags=r-ver-test-"${TAG}" \
--load \
r-ver
- name: inspect image
run: |
make inspect-image/r-ver-test-"${{ matrix.tag }}"
make inspect-image/r-ver-test-"${{ env.TAG }}"
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
Expand All @@ -60,9 +65,8 @@ jobs:
strategy:
fail-fast: false
matrix:
# TODO: use the latest tag automatically
tag:
- "4.3.3"
- "latest"
platforms:
- linux/amd64
script:
Expand All @@ -79,15 +83,21 @@ jobs:
uses: crazy-max/ghaction-github-runtime@v3
- name: test build
run: |
if [ "${{ matrix.tag }}" == "latest" ]; then
TAG="$(jq '.r_version[0]' -r build/matrix/latest.json)"
else
TAG="${{ matrix.tag }}"
fi
echo "TAG=${TAG}" >>"$GITHUB_ENV"
docker buildx bake \
-f bakefiles/"${{ matrix.tag }}".docker-bake.json \
-f bakefiles/"${TAG}".docker-bake.json \
--set=*.platform="${{ matrix.platforms }}" \
--set=*.cache-from=docker.io/rocker/r-ver:"${{ matrix.tag }}" \
--set=*.cache-from=type=gha,scope=r-ver-"${{ matrix.tag }}" \
--set=*.cache-to=type=gha,scope=r-ver-"${{ matrix.tag }}" \
--set=r-ver.tags=r-ver-test-"${{ matrix.tag }}" \
--set=*.cache-from=docker.io/rocker/r-ver:"${TAG}" \
--set=*.cache-from=type=gha,scope=r-ver-"${TAG}" \
--set=*.cache-to=type=gha,scope=r-ver-"${TAG}" \
--set=r-ver.tags=r-ver-test-"${TAG}" \
--load \
r-ver
- name: test run rocker scripts
run: |
docker run --rm r-ver-test-"${{ matrix.tag }}" "/rocker_scripts/${{ matrix.script }}"
docker run --rm r-ver-test-"${{ env.TAG }}" "/rocker_scripts/${{ matrix.script }}"

0 comments on commit d29f05f

Please sign in to comment.