Skip to content

Commit 9ec57ed

Browse files
authored
Merge pull request #274 from crazy-max/update-workflows
ci: split validate and test workflow
2 parents 2bdac10 + 0ef9f13 commit 9ec57ed

File tree

3 files changed

+42
-12
lines changed

3 files changed

+42
-12
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@ name: ci
22

33
on:
44
schedule:
5-
- cron: '0 */4 * * *' # every 4 hours
5+
- cron: '0 10 * * *'
66
push:
77
branches:
88
- 'master'
99
- 'releases/v*'
1010
tags:
1111
- 'v*.*.*'
1212
pull_request:
13-
branches:
14-
- 'master'
15-
- 'releases/v*'
1613

1714
env:
1815
DOCKER_IMAGE: localhost:5000/name/app

.github/workflows/test.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ on:
66
- 'master'
77
- 'releases/v*'
88
pull_request:
9-
branches:
10-
- 'master'
11-
- 'releases/v*'
129

1310
jobs:
1411
test:
@@ -17,11 +14,6 @@ jobs:
1714
-
1815
name: Checkout
1916
uses: actions/checkout@v3
20-
-
21-
name: Validate
22-
uses: docker/bake-action@v2
23-
with:
24-
targets: validate
2517
-
2618
name: Test
2719
uses: docker/bake-action@v2

.github/workflows/validate.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: validate
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
- 'releases/v*'
8+
pull_request:
9+
10+
jobs:
11+
prepare:
12+
runs-on: ubuntu-latest
13+
outputs:
14+
targets: ${{ steps.targets.outputs.matrix }}
15+
steps:
16+
-
17+
name: Checkout
18+
uses: actions/checkout@v3
19+
-
20+
name: Targets matrix
21+
id: targets
22+
run: |
23+
echo "matrix=$(docker buildx bake validate --print | jq -cr '.group.validate.targets')" >> $GITHUB_OUTPUT
24+
25+
validate:
26+
runs-on: ubuntu-latest
27+
needs:
28+
- prepare
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
target: ${{ fromJson(needs.prepare.outputs.targets) }}
33+
steps:
34+
-
35+
name: Checkout
36+
uses: actions/checkout@v3
37+
-
38+
name: Validate
39+
uses: docker/bake-action@v2
40+
with:
41+
targets: ${{ matrix.target }}

0 commit comments

Comments
 (0)