Skip to content

Commit d90f277

Browse files
committed
ci: split build and bake tests
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
1 parent 7eeaea0 commit d90f277

2 files changed

Lines changed: 284 additions & 252 deletions

File tree

.github/workflows/.test-bake.yml

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

0 commit comments

Comments
 (0)