Skip to content

Commit 7a346af

Browse files
committed
chore: split build-push to re-usable workflow
1 parent 6f494e5 commit 7a346af

2 files changed

Lines changed: 62 additions & 50 deletions

File tree

.github/workflows/build-push.yml

Lines changed: 2 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,7 @@
22
name: Build & Push
33

44
on:
5-
merge_group:
6-
pull_request:
7-
push:
8-
tags: ["v*.*.*"]
9-
workflow_dispatch:
10-
11-
concurrency:
12-
group: ${{ github.ref }}-${{ github.workflow }}
13-
cancel-in-progress: true
5+
workflow_call:
146

157
permissions:
168
contents: read
@@ -125,7 +117,7 @@ jobs:
125117
images: ${{ env.REGISTRY }}/${{ github.repository }}-${{ matrix.flavor }}
126118
# Generate Docker tags based on the following events/attributes
127119
tags: |
128-
type=raw,value=latest,enable={{is_default_branch}}
120+
type=edge
129121
type=ref,event=pr
130122
type=semver,pattern={{raw}}
131123
type=semver,pattern={{version}}
@@ -196,43 +188,3 @@ jobs:
196188
UPDATED_NOTES=${UPDATED_NOTES//'{{ amp-devcontainer-${{ matrix.flavor }}-version }}'/'${{ github.ref_name }}'}
197189
UPDATED_NOTES=${UPDATED_NOTES//'{{ amp-devcontainer-${{ matrix.flavor }}-sha }}'/'${{ steps.inspect-manifest.outputs.digest }}'}
198190
gh release edit ${{ github.ref_name }} --notes "${UPDATED_NOTES}"
199-
200-
integration-test:
201-
if: github.event_name == 'pull_request'
202-
strategy:
203-
matrix:
204-
flavor: [cpp, rust]
205-
runner: ["ubuntu-latest", "ubuntu-24.04-arm"]
206-
needs: merge-image
207-
secrets: inherit
208-
uses: ./.github/workflows/integration-test.yml
209-
with:
210-
flavor: ${{ matrix.flavor }}
211-
runner: ${{ matrix.runner }}
212-
213-
acceptance-test:
214-
if: github.event_name == 'pull_request'
215-
needs: merge-image
216-
secrets: inherit
217-
uses: ./.github/workflows/acceptance-test.yml
218-
with:
219-
flavor: cpp
220-
221-
publish-test-results:
222-
runs-on: ubuntu-latest
223-
permissions:
224-
checks: write
225-
pull-requests: write
226-
needs: [acceptance-test, integration-test]
227-
if: always()
228-
steps:
229-
- uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
230-
with:
231-
egress-policy: audit
232-
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
233-
with:
234-
merge-multiple: true
235-
pattern: test-results-*
236-
- uses: EnricoMi/publish-unit-test-result-action@3a74b2957438d0b6e2e61d67b05318aa25c9e6c6 # v2.20.0
237-
with:
238-
files: test-report-*.xml
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
name: Continuous Integration
3+
4+
on:
5+
merge_group:
6+
pull_request:
7+
push:
8+
branches: [main]
9+
tags: ["v*.*.*"]
10+
workflow_dispatch:
11+
12+
concurrency:
13+
group: ${{ github.ref }}-${{ github.workflow }}
14+
cancel-in-progress: true
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
build-push:
21+
uses: ./.github/workflows/build-push.yml
22+
secrets: inherit
23+
24+
integration-test:
25+
strategy:
26+
matrix:
27+
flavor: [cpp, rust]
28+
runner: ["ubuntu-latest", "ubuntu-24.04-arm"]
29+
needs: build-push
30+
uses: ./.github/workflows/integration-test.yml
31+
secrets: inherit
32+
with:
33+
flavor: ${{ matrix.flavor }}
34+
runner: ${{ matrix.runner }}
35+
36+
acceptance-test:
37+
needs: build-push
38+
uses: ./.github/workflows/acceptance-test.yml
39+
secrets: inherit
40+
with:
41+
flavor: cpp
42+
43+
publish-test-results:
44+
runs-on: ubuntu-latest
45+
permissions:
46+
checks: write
47+
pull-requests: write
48+
needs: [acceptance-test, integration-test]
49+
if: always()
50+
steps:
51+
- uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
52+
with:
53+
egress-policy: audit
54+
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
55+
with:
56+
merge-multiple: true
57+
pattern: test-results-*
58+
- uses: EnricoMi/publish-unit-test-result-action@3a74b2957438d0b6e2e61d67b05318aa25c9e6c6 # v2.20.0
59+
with:
60+
files: test-report-*.xml

0 commit comments

Comments
 (0)