Skip to content

Commit f0c82b6

Browse files
committed
Play around a bit with setting the config matrix on a previous job
1 parent 0a44d49 commit f0c82b6

File tree

1 file changed

+30
-10
lines changed

1 file changed

+30
-10
lines changed

.github/workflows/check-bioc.yml

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,43 @@ env:
4040
has_RUnit: 'false'
4141
cache-version: 'cache-v1'
4242
run_docker: 'false'
43+
latest_release: 'true'
4344

4445
jobs:
45-
build-check:
46-
runs-on: ${{ matrix.config.os }}
47-
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
48-
container: ${{ matrix.config.cont }}
49-
## Environment variables unique to this job.
46+
bioc-config:
47+
runs-on: ubuntu-latest
48+
outputs:
49+
matrix: ${{ steps.set-matrix.outputs.matrix }}
50+
steps:
51+
- id: set-bioc-matrix
52+
run: |
53+
bioc=$(curl -L https://bioconductor.org/config.yaml)
54+
if [[ "$latest_release" == "true" ]]; then
55+
echo "Finding the latest BioC release version and the corresponding R version"
56+
biocversion=$(echo $bioc | grep "release_version: " | grep -Eo "[0-9]{1}\.[0-9]{2}")
57+
rversion=$(echo $bioc | grep "r_version_associated_with_release: " | grep -Eo "[0-9]{1}\.[0-9]{1}")
58+
biocmajor=$(echo $biocversion | cut -c 1-1)
59+
biocminor=$(echo $biocversion | cut -c 3-4)
60+
bioccont="bioconductor/bioconductor_docker:RELEASE_${biocmajor}_${biocminor}"
61+
else
62+
echo "Finding the latest BioC devel version and the corresponding R version"
63+
biocversion=$(echo $bioc | grep "devel_version: " | grep -Eo "[0-9]{1}\.[0-9]{2}")
64+
rversion=$(echo $bioc | grep "r_version_associated_with_devel: " | grep -Eo "[0-9]{1}\.[0-9]{1}")
65+
bioccont="bioconductor/bioconductor_docker:devel"
66+
fi
67+
echo "matrix={ \"config\": { [{\"os\" : \"ubuntu-latest\", \"r\" : \"${rversion}\", \"bioc\" : \"${biocversion}\", \"cont\" : \"${bioccont}\"} , {\"os\" : \"macOS-latest\", \"r\" : \"${rversion}\", \"bioc\" : \"${biocversion}\"} , {\"os\" : \"windows-latest\", \"r\" : \"${rversion}\", \"bioc\" : \"${biocversion}\" }] } }"
5068
69+
build-check:
70+
needs: bioc-config
5171
strategy:
5272
fail-fast: false
53-
matrix:
54-
config:
55-
- { os: ubuntu-latest, r: '4.4', bioc: '3.20', cont: "bioconductor/bioconductor_docker:RELEASE_3_20"}
56-
- { os: macOS-latest, r: '4.4', bioc: '3.20'}
57-
- { os: windows-latest, r: '4.4', bioc: '3.20'}
73+
matrix: ${{fromJson(needs.bioc-config.outputs.matrix)}}
5874
## Check https://github.com/r-lib/actions/tree/master/examples
5975
## for examples using the http-user-agent
76+
runs-on: ${{ matrix.config.os }}
77+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
78+
container: ${{ matrix.config.cont }}
79+
## Environment variables unique to this job.
6080
env:
6181
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
6282
NOT_CRAN: true

0 commit comments

Comments
 (0)