#2: use YAML reference features in config #77
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build docker images | |
# Template workflow to build and test a project in all available setup configurations | |
# WIP: This is currently a work in progress (#2: Docker image usage) | |
on: | |
push: | |
branches: | |
- 2-implement-common-docker-containers | |
jobs: | |
get-matrix: | |
name: Retrieve Setup matrix | |
runs-on: ubuntu-latest | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
CI_REPO: DARMA-tasking/workflows | |
CI_BRANCH: 2-implement-common-docker-containers # should be master in the future | |
steps: | |
- name: Retrieve Setup matrix | |
id: get-matrix | |
run: | | |
wget https://raw.githubusercontent.com/${{ env.CI_REPO }}/refs/heads/${{ env.CI_BRANCH }}/ci/shared/matrix/github.json | |
matrix=$(cat github.json | jq '.matrix' | jq -c '[ .[] | select( .image != null) ]') | |
echo "runner=$(echo $matrix)" >> $GITHUB_OUTPUT | |
outputs: | |
matrix: ${{ steps.get-matrix.outputs.runner }} | |
run: | |
name: Build docker image (${{ matrix.runner.label }}) | |
runs-on: ${{ matrix.runner.runs-on }} | |
needs: get-matrix | |
strategy: | |
fail-fast: false | |
matrix: | |
runner: ${{ fromJson(needs.get-matrix.outputs.matrix ) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- run: pip install pyyaml | |
- name: Docker image build | |
run: | | |
python ci/build-docker-image ${{ matrix.runner.image }} |