Skip to content

Dockerfile tests and cleanup imputation/PRS #6

Dockerfile tests and cleanup imputation/PRS

Dockerfile tests and cleanup imputation/PRS #6

name: Dockerfile tests
on:
push:
branches:
- main
pull_request:
paths:
- '**/Dockerfile'
schedule:
- cron: '23 2 * * 0'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
define_changed_dockerfile_matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.changed-dockerfiles.outputs.all_changed_files }}
steps:
- uses: actions/checkout@v4
-
name: Get Changed Dockerfiles
id: changed-dockerfiles
uses: tj-actions/changed-files@v44
with:
matrix: true
files: '**Dockerfile'
define_all_dockerfile_matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.all-dockerfiles.outputs.files}}
steps:
- uses: actions/checkout@v4
-
name: Get all Dockerfiles
id: all-dockerfiles
run: |
find . -name "Dockerfile" | jq -Rs '{"files": split("\n") | map(select(. != ""))}' >> "$GITHUB_OUTPUT"
test_builds:
runs-on: ubuntu-latest
needs: [define_changed_dockerfile_matrix, define_all_dockerfile_matrix]
strategy:
matrix:
dockerfile: ${{ github.ref != 'refs/heads/main' && fromJSON(needs.define_changed_dockerfile_matrix.outputs.matrix) || fromJSON(needs.define_all_dockerfile_matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
-
name: Get context
id: get-context
run: |
echo "context=$(dirname ${{ matrix.dockerfile }})" >> $GITHUB_OUTPUT
-
name: Build
uses: docker/build-push-action@v6
with:
context: ${{ get-context.outputs.context }}

Check failure on line 60 in .github/workflows/test_dockerfiles.yaml

View workflow run for this annotation

GitHub Actions / Dockerfile tests

Invalid workflow file

The workflow is not valid. .github/workflows/test_dockerfiles.yaml (Line: 60, Col: 20): Unrecognized named-value: 'get-context'. Located at position 1 within expression: get-context.outputs.context
file: ${{ matrix.dockerfile }}