Skip to content

Commit 7acb2a1

Browse files
committed
chore(build): test umbrella job to build the client in a coordinated process
1 parent aa1663e commit 7acb2a1

File tree

4 files changed

+99
-42
lines changed

4 files changed

+99
-42
lines changed

.github/workflows/bff_develop.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,35 @@
44
name: BFF Develop
55

66
on:
7-
push:
8-
branches:
9-
- develop
10-
paths:
11-
- iris-client-bff/**
12-
- .github/workflows/bff_develop.yml
13-
pull_request:
14-
branches:
15-
- develop
7+
workflow_call
168

179
defaults:
1810
run:
1911
shell: bash
2012

2113
jobs:
14+
pre_job:
15+
name: Determines job skipping
16+
# continue-on-error: true # Uncomment once integration is finished
17+
runs-on: ubuntu-latest
18+
# Map a step output to a job output
19+
outputs:
20+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
21+
steps:
22+
- id: skip_check
23+
uses: fkirc/skip-duplicate-actions@master
24+
with:
25+
# All of these options are optional, so you can remove them if you are happy with the defaults
26+
skip_after_successful_duplicate: 'false'
27+
concurrent_skipping: 'never'
28+
cancel_others: 'true'
29+
paths: '["iris-client-bff/**", ".github/workflows/bff_develop.yml"]'
30+
paths_ignore: '["**/README.md", "**/docs/**", "**/postman/**"]'
31+
2232
build_and_push:
2333
name: Build and push to docker.io
34+
needs: pre_job
35+
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
2436
runs-on: ubuntu-latest
2537

2638
# Map a step output to a job output
@@ -67,15 +79,3 @@ jobs:
6779
**/surefire-reports/*.xml
6880
**/failsafe-reports/*.xml
6981
!**/failsafe-reports/failsafe-summary.xml
70-
71-
publish-test-results:
72-
name: Publish Test Results
73-
needs: build_and_push
74-
uses: iris-connect/iris-client/.github/workflows/publish-test-results.yml@develop
75-
76-
container_scan:
77-
name: Container Scan
78-
needs: build_and_push
79-
uses: iris-connect/iris-client/.github/workflows/trivy-container-scan.yml@develop
80-
with:
81-
image-refs: "[ '${{needs.build_and_push.outputs.image-ref}}' ]"
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Client Develop
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
pull_request:
8+
branches:
9+
- develop
10+
11+
jobs:
12+
bff:
13+
name: Build BFF
14+
uses: iris-connect/iris-client/.github/workflows/bff_develop.yml@chore/optimized_build
15+
16+
publish-test-results:
17+
name: Publish Test Results
18+
needs: bff
19+
uses: iris-connect/iris-client/.github/workflows/publish-test-results.yml@develop
20+
21+
fe:
22+
name: Build FE
23+
uses: iris-connect/iris-client/.github/workflows/fe_develop.yml@chore/optimized_build
24+
25+
e2e_test:
26+
name: Run E2E Tests
27+
needs: bff
28+
uses: iris-connect/iris-client/.github/workflows/fe-e2e-test.yml@chore/optimized_build
29+
30+
container_scan:
31+
name: Container Scan
32+
needs: [bff, fe]
33+
uses: iris-connect/iris-client/.github/workflows/trivy-container-scan.yml@develop
34+
with:
35+
image-refs: "[ '${{needs.bff.outputs.image-ref}}', '${{needs.fe.outputs.image-ref}}' ]"

.github/workflows/fe-e2e-test.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,32 @@ on:
55
branches:
66
- main
77
- release
8-
- develop
98
- 1.**
10-
pull_request:
11-
branches:
12-
- develop
9+
workflow_call:
1310

1411
jobs:
12+
pre_job:
13+
name: Determines job skipping
14+
# continue-on-error: true # Uncomment once integration is finished
15+
runs-on: ubuntu-latest
16+
# Map a step output to a job output
17+
outputs:
18+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
19+
steps:
20+
- id: skip_check
21+
uses: fkirc/skip-duplicate-actions@master
22+
with:
23+
# All of these options are optional, so you can remove them if you are happy with the defaults
24+
skip_after_successful_duplicate: 'true'
25+
concurrent_skipping: 'never'
26+
cancel_others: 'true'
27+
paths_ignore: '["**/README.md", "**/docs/**", "**/postman/**", ".reuse/**", "infrastructure/**", "LICENSES/**", "iris-client-eps/**"]'
28+
1529
cypress-run:
16-
runs-on: ubuntu-20.04
30+
name: Run Cypress E2E Tests
31+
needs: pre_job
32+
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
33+
runs-on: ubuntu-latest
1734
steps:
1835
- name: Checkout
1936
uses: actions/[email protected]

.github/workflows/fe_develop.yml

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,31 @@
11
name: FE Develop
22

33
on:
4-
push:
5-
branches:
6-
- develop
7-
paths:
8-
- iris-client-fe/**
9-
- .github/workflows/fe_develop.yml
10-
pull_request:
11-
branches:
12-
- develop
4+
workflow_call
135

146
jobs:
7+
pre_job:
8+
name: Determines job skipping
9+
# continue-on-error: true # Uncomment once integration is finished
10+
runs-on: ubuntu-latest
11+
# Map a step output to a job output
12+
outputs:
13+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
14+
steps:
15+
- id: skip_check
16+
uses: fkirc/skip-duplicate-actions@master
17+
with:
18+
# All of these options are optional, so you can remove them if you are happy with the defaults
19+
skip_after_successful_duplicate: 'false'
20+
concurrent_skipping: 'never'
21+
cancel_others: 'true'
22+
paths: '["iris-client-fe/**", ".github/workflows/fe_develop.yml"]'
23+
paths_ignore: '["**/README.md", "**/docs/**", "**/postman/**"]'
24+
1525
build_and_push:
1626
name: Build and push to docker.io
27+
needs: pre_job
28+
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
1729
runs-on: ubuntu-latest
1830

1931
# Map a step output to a job output
@@ -50,10 +62,3 @@ jobs:
5062
VUE_APP_BUILD_ID=${{ github.sha }}
5163
labels: |
5264
iris.client-fe.image.revision=${{ github.sha }}
53-
54-
container_scan:
55-
name: Container Scan
56-
needs: build_and_push
57-
uses: iris-connect/iris-client/.github/workflows/trivy-container-scan.yml@develop
58-
with:
59-
image-refs: "[ '${{needs.build_and_push.outputs.image-ref}}' ]"

0 commit comments

Comments
 (0)