Skip to content

Commit c03000f

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

File tree

4 files changed

+115
-42
lines changed

4 files changed

+115
-42
lines changed

.github/workflows/bff_develop.yml

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,40 @@
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:
8+
secrets:
9+
DOCKER_HUB_USER:
10+
required: true
11+
DOCKER_HUB_PW:
12+
required: true
1613

1714
defaults:
1815
run:
1916
shell: bash
2017

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

2643
# Map a step output to a job output
@@ -67,15 +84,3 @@ jobs:
6784
**/surefire-reports/*.xml
6885
**/failsafe-reports/*.xml
6986
!**/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: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
secrets:
16+
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
17+
DOCKER_HUB_PW: ${{ secrets.DOCKER_HUB_PW }}
18+
19+
publish-test-results:
20+
name: Publish Test Results
21+
needs: bff
22+
uses: iris-connect/iris-client/.github/workflows/publish-test-results.yml@develop
23+
24+
fe:
25+
name: Build FE
26+
uses: iris-connect/iris-client/.github/workflows/fe_develop.yml@chore/optimized_build
27+
secrets:
28+
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
29+
DOCKER_HUB_PW: ${{ secrets.DOCKER_HUB_PW }}
30+
31+
e2e_test:
32+
name: Run E2E Tests
33+
needs: bff
34+
uses: iris-connect/iris-client/.github/workflows/fe-e2e-test.yml@chore/optimized_build
35+
36+
container_scan:
37+
name: Container Scan
38+
needs: [bff, fe]
39+
uses: iris-connect/iris-client/.github/workflows/trivy-container-scan.yml@develop
40+
with:
41+
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: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,36 @@
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:
5+
secrets:
6+
DOCKER_HUB_USER:
7+
required: true
8+
DOCKER_HUB_PW:
9+
required: true
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: 'false'
25+
concurrent_skipping: 'never'
26+
cancel_others: 'true'
27+
paths: '["iris-client-fe/**", ".github/workflows/fe_develop.yml"]'
28+
paths_ignore: '["**/README.md", "**/docs/**", "**/postman/**"]'
29+
1530
build_and_push:
1631
name: Build and push to docker.io
32+
needs: pre_job
33+
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
1734
runs-on: ubuntu-latest
1835

1936
# Map a step output to a job output
@@ -50,10 +67,3 @@ jobs:
5067
VUE_APP_BUILD_ID=${{ github.sha }}
5168
labels: |
5269
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)