From 667a8e01151e8da69e4f67214006a3f85eeedb95 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Tue, 21 Feb 2023 00:09:11 +0100 Subject: [PATCH] ci: split validate job in a matrix Signed-off-by: CrazyMax --- .github/workflows/ci.yml | 5 +---- .github/workflows/test.yml | 3 --- .github/workflows/validate.yml | 25 +++++++++++++++++++++---- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc67342..503861c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,7 @@ name: ci on: schedule: - - cron: '0 10 * * *' # everyday at 10am + - cron: '0 10 * * *' push: branches: - 'master' @@ -10,9 +10,6 @@ on: tags: - 'v*' pull_request: - branches: - - 'master' - - 'releases/v*' jobs: bake: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 140c292..80a52e3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,9 +6,6 @@ on: - 'master' - 'releases/v*' pull_request: - branches: - - 'master' - - 'releases/v*' jobs: test: diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 1484c60..33fc0db 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -6,13 +6,30 @@ on: - 'master' - 'releases/v*' pull_request: - branches: - - 'master' - - 'releases/v*' jobs: + prepare: + runs-on: ubuntu-latest + outputs: + targets: ${{ steps.targets.outputs.matrix }} + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Targets matrix + id: targets + run: | + echo "matrix=$(docker buildx bake validate --print | jq -cr '.group.validate.targets')" >> $GITHUB_OUTPUT + validate: runs-on: ubuntu-latest + needs: + - prepare + strategy: + fail-fast: false + matrix: + target: ${{ fromJson(needs.prepare.outputs.targets) }} steps: - name: Checkout @@ -21,4 +38,4 @@ jobs: name: Validate uses: docker/bake-action@v2 with: - targets: validate + targets: ${{ matrix.target }}