Skip to content

Commit 65a88d8

Browse files
committed
ci: split test workflow
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
1 parent ee9ed7a commit 65a88d8

File tree

2 files changed

+268
-252
lines changed

2 files changed

+268
-252
lines changed

.github/workflows/.test-bake.yml

Lines changed: 267 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,267 @@
1+
name: .test-bake
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
on:
8+
workflow_dispatch:
9+
push:
10+
branches:
11+
- 'main'
12+
- 'releases/v*'
13+
tags:
14+
- 'v*'
15+
pull_request:
16+
17+
jobs:
18+
bake-aws-single:
19+
uses: ./.github/workflows/bake.yml
20+
permissions:
21+
contents: read
22+
id-token: write
23+
with:
24+
context: test
25+
target: hello
26+
output: image
27+
push: ${{ github.event_name != 'pull_request' }}
28+
cache: true
29+
cache-scope: bake-aws
30+
meta-images: |
31+
public.ecr.aws/q3b5f1u4/test-docker-action
32+
meta-tags: |
33+
type=raw,value=bake-ghbuilder-single-${{ github.run_id }}
34+
bake-sbom: true
35+
secrets:
36+
registry-auths: |
37+
- registry: public.ecr.aws
38+
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
39+
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
40+
41+
bake-aws-single-verify:
42+
uses: ./.github/workflows/verify.yml
43+
if: ${{ github.event_name != 'pull_request' }}
44+
needs:
45+
- bake-aws-single
46+
with:
47+
builder-outputs: ${{ toJSON(needs.bake-aws-single.outputs) }}
48+
secrets:
49+
registry-auths: |
50+
- registry: public.ecr.aws
51+
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
52+
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
53+
54+
bake-aws-single-outputs:
55+
runs-on: ubuntu-24.04
56+
needs:
57+
- bake-aws-single
58+
steps:
59+
-
60+
name: Builder outputs
61+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
62+
env:
63+
INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.bake-aws-single.outputs) }}
64+
with:
65+
script: |
66+
const builderOutputs = JSON.parse(core.getInput('builder-outputs'));
67+
core.info(JSON.stringify(builderOutputs, null, 2));
68+
69+
bake-aws:
70+
uses: ./.github/workflows/bake.yml
71+
permissions:
72+
contents: read
73+
id-token: write
74+
with:
75+
context: test
76+
target: hello-cross
77+
output: image
78+
push: ${{ github.event_name != 'pull_request' }}
79+
cache: true
80+
cache-scope: bake-aws
81+
meta-images: |
82+
public.ecr.aws/q3b5f1u4/test-docker-action
83+
meta-tags: |
84+
type=raw,value=bake-ghbuilder-${{ github.run_id }}
85+
bake-sbom: true
86+
secrets:
87+
registry-auths: |
88+
- registry: public.ecr.aws
89+
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
90+
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
91+
92+
bake-aws-verify:
93+
uses: ./.github/workflows/verify.yml
94+
if: ${{ github.event_name != 'pull_request' }}
95+
needs:
96+
- bake-aws
97+
with:
98+
builder-outputs: ${{ toJSON(needs.bake-aws.outputs) }}
99+
secrets:
100+
registry-auths: |
101+
- registry: public.ecr.aws
102+
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
103+
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
104+
105+
bake-aws-outputs:
106+
runs-on: ubuntu-24.04
107+
needs:
108+
- bake-aws
109+
steps:
110+
-
111+
name: Builder outputs
112+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
113+
env:
114+
INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.bake-aws.outputs) }}
115+
with:
116+
script: |
117+
const builderOutputs = JSON.parse(core.getInput('builder-outputs'));
118+
core.info(JSON.stringify(builderOutputs, null, 2));
119+
120+
bake-ghcr-and-aws:
121+
uses: ./.github/workflows/bake.yml
122+
permissions:
123+
contents: read
124+
id-token: write
125+
packages: write
126+
with:
127+
context: test
128+
target: hello-cross
129+
output: image
130+
push: ${{ github.event_name != 'pull_request' }}
131+
cache: true
132+
cache-scope: bake-aws
133+
meta-images: |
134+
ghcr.io/docker/github-builder-test
135+
public.ecr.aws/q3b5f1u4/test-docker-action
136+
meta-tags: |
137+
type=raw,value=${{ github.run_id }},prefix=bake-ghcr-and-aws-
138+
bake-sbom: true
139+
secrets:
140+
registry-auths: |
141+
- registry: ghcr.io
142+
username: ${{ github.actor }}
143+
password: ${{ secrets.GITHUB_TOKEN }}
144+
- registry: public.ecr.aws
145+
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
146+
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
147+
148+
bake-ghcr-and-aws-verify:
149+
uses: ./.github/workflows/verify.yml
150+
if: ${{ github.event_name != 'pull_request' }}
151+
needs:
152+
- bake-ghcr-and-aws
153+
with:
154+
builder-outputs: ${{ toJSON(needs.bake-ghcr-and-aws.outputs) }}
155+
secrets:
156+
registry-auths: |
157+
- registry: ghcr.io
158+
username: ${{ github.actor }}
159+
password: ${{ secrets.GITHUB_TOKEN }}
160+
- registry: public.ecr.aws
161+
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
162+
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
163+
164+
bake-ghcr-and-aws-outputs:
165+
runs-on: ubuntu-24.04
166+
needs:
167+
- bake-ghcr-and-aws
168+
steps:
169+
-
170+
name: Builder outputs
171+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
172+
env:
173+
INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.bake-ghcr-and-aws.outputs) }}
174+
with:
175+
script: |
176+
const builderOutputs = JSON.parse(core.getInput('builder-outputs'));
177+
core.info(JSON.stringify(builderOutputs, null, 2));
178+
179+
bake-local:
180+
uses: ./.github/workflows/bake.yml
181+
permissions:
182+
contents: read
183+
id-token: write
184+
with:
185+
context: test
186+
target: hello-cross
187+
output: local
188+
push: ${{ github.event_name != 'pull_request' }}
189+
cache: true
190+
artifact-name: bake-output
191+
bake-sbom: true
192+
193+
bake-local-verify:
194+
uses: ./.github/workflows/verify.yml
195+
if: ${{ github.event_name != 'pull_request' }}
196+
needs:
197+
- bake-local
198+
with:
199+
builder-outputs: ${{ toJSON(needs.bake-local.outputs) }}
200+
201+
bake-local-outputs:
202+
runs-on: ubuntu-24.04
203+
needs:
204+
- bake-local
205+
steps:
206+
-
207+
name: Builder outputs
208+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
209+
env:
210+
INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.bake-local.outputs) }}
211+
with:
212+
script: |
213+
const builderOutputs = JSON.parse(core.getInput('builder-outputs'));
214+
core.info(JSON.stringify(builderOutputs, null, 2));
215+
216+
bake-local-single:
217+
uses: ./.github/workflows/bake.yml
218+
permissions:
219+
contents: read
220+
id-token: write
221+
with:
222+
context: test
223+
target: hello
224+
output: local
225+
push: ${{ github.event_name != 'pull_request' }}
226+
cache: true
227+
artifact-name: bake-output-single
228+
bake-sbom: true
229+
230+
bake-local-single-verify:
231+
uses: ./.github/workflows/verify.yml
232+
if: ${{ github.event_name != 'pull_request' }}
233+
needs:
234+
- bake-local-single
235+
with:
236+
builder-outputs: ${{ toJSON(needs.bake-local-single.outputs) }}
237+
238+
bake-local-single-outputs:
239+
runs-on: ubuntu-24.04
240+
needs:
241+
- bake-local-single
242+
steps:
243+
-
244+
name: Builder outputs
245+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
246+
env:
247+
INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.bake-local-single.outputs) }}
248+
with:
249+
script: |
250+
const builderOutputs = JSON.parse(core.getInput('builder-outputs'));
251+
core.info(JSON.stringify(builderOutputs, null, 2));
252+
253+
bake-set-runner:
254+
uses: ./.github/workflows/bake.yml
255+
permissions:
256+
contents: read
257+
id-token: write
258+
with:
259+
runner: amd64
260+
context: test
261+
target: hello-cross
262+
output: image
263+
push: false
264+
meta-images: |
265+
public.ecr.aws/q3b5f1u4/test-docker-action
266+
meta-tags: |
267+
type=raw,value=bake-ghbuilder-${{ github.run_id }}

0 commit comments

Comments
 (0)