Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: split test and validate workflow #413

Merged
merged 2 commits into from May 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 5 additions & 4 deletions .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:
Expand All @@ -11,9 +15,6 @@ on:
tags:
- 'v*'
pull_request:
branches:
- 'master'
- 'releases/v*'

jobs:
ci:
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/test.yml
@@ -1,5 +1,9 @@
name: test

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
push:
branches:
Expand All @@ -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
Expand Down
45 changes: 45 additions & 0 deletions .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 }}