diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41dcbc1..1c4ceb3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,8 +1,12 @@ name: ci +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + on: schedule: - - cron: '0 10 * * *' # everyday at 10am + - cron: '0 10 * * *' workflow_dispatch: push: branches: @@ -11,9 +15,6 @@ on: tags: - 'v*' pull_request: - branches: - - 'master' - - 'releases/v*' jobs: ci: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4f1ff3d..f47a902 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,9 @@ name: test +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + on: push: branches: @@ -16,11 +20,6 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 - - - name: Validate - uses: docker/bake-action@v3 - with: - targets: validate - name: Test uses: docker/bake-action@v3 diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 0000000..bc32ce1 --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,45 @@ +name: validate + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + push: + branches: + - 'master' + - 'releases/v*' + pull_request: + +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 + uses: actions/checkout@v3 + - + name: Validate + uses: docker/bake-action@v3 + with: + targets: ${{ matrix.target }}