Skip to content

Commit

Permalink
ci: split validate and test workflow
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
  • Loading branch information
crazy-max committed Feb 21, 2023
1 parent 0524f79 commit 8f5c315
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 12 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@ name: ci

on:
schedule:
- cron: '0 */4 * * *' # every 4 hours
- cron: '0 10 * * *'
push:
branches:
- 'master'
- 'releases/v*'
tags:
- 'v*.*.*'
pull_request:
branches:
- 'master'
- 'releases/v*'

env:
DOCKER_IMAGE: localhost:5000/name/app
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
- 'master'
- 'releases/v*'
pull_request:
branches:
- 'master'
- 'releases/v*'

jobs:
test:
Expand All @@ -17,11 +14,6 @@ jobs:
-
name: Checkout
uses: actions/checkout@v3
-
name: Validate
uses: docker/bake-action@v2
with:
targets: validate
-
name: Test
uses: docker/bake-action@v2
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: validate

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@v2
with:
targets: ${{ matrix.target }}

0 comments on commit 8f5c315

Please sign in to comment.