From 7acb2a1be26e7fe2f7932982078f2ce1521ba715 Mon Sep 17 00:00:00 2001 From: Jens Kutzsche Date: Tue, 9 Nov 2021 09:43:08 +0100 Subject: [PATCH] chore(build): test umbrella job to build the client in a coordinated process --- .github/workflows/bff_develop.yml | 42 ++++++++++++++-------------- .github/workflows/client_develop.yml | 35 +++++++++++++++++++++++ .github/workflows/fe-e2e-test.yml | 27 ++++++++++++++---- .github/workflows/fe_develop.yml | 37 +++++++++++++----------- 4 files changed, 99 insertions(+), 42 deletions(-) create mode 100644 .github/workflows/client_develop.yml diff --git a/.github/workflows/bff_develop.yml b/.github/workflows/bff_develop.yml index b67da6893..96c1dded0 100644 --- a/.github/workflows/bff_develop.yml +++ b/.github/workflows/bff_develop.yml @@ -4,23 +4,35 @@ name: BFF Develop on: - push: - branches: - - develop - paths: - - iris-client-bff/** - - .github/workflows/bff_develop.yml - pull_request: - branches: - - develop + workflow_call defaults: run: shell: bash jobs: + pre_job: + name: Determines job skipping + # continue-on-error: true # Uncomment once integration is finished + runs-on: ubuntu-latest + # Map a step output to a job output + outputs: + should_skip: ${{ steps.skip_check.outputs.should_skip }} + steps: + - id: skip_check + uses: fkirc/skip-duplicate-actions@master + with: + # All of these options are optional, so you can remove them if you are happy with the defaults + skip_after_successful_duplicate: 'false' + concurrent_skipping: 'never' + cancel_others: 'true' + paths: '["iris-client-bff/**", ".github/workflows/bff_develop.yml"]' + paths_ignore: '["**/README.md", "**/docs/**", "**/postman/**"]' + build_and_push: name: Build and push to docker.io + needs: pre_job + if: ${{ needs.pre_job.outputs.should_skip != 'true' }} runs-on: ubuntu-latest # Map a step output to a job output @@ -67,15 +79,3 @@ jobs: **/surefire-reports/*.xml **/failsafe-reports/*.xml !**/failsafe-reports/failsafe-summary.xml - - publish-test-results: - name: Publish Test Results - needs: build_and_push - uses: iris-connect/iris-client/.github/workflows/publish-test-results.yml@develop - - container_scan: - name: Container Scan - needs: build_and_push - uses: iris-connect/iris-client/.github/workflows/trivy-container-scan.yml@develop - with: - image-refs: "[ '${{needs.build_and_push.outputs.image-ref}}' ]" diff --git a/.github/workflows/client_develop.yml b/.github/workflows/client_develop.yml new file mode 100644 index 000000000..000538af3 --- /dev/null +++ b/.github/workflows/client_develop.yml @@ -0,0 +1,35 @@ +name: Client Develop + +on: + push: + branches: + - develop + pull_request: + branches: + - develop + +jobs: + bff: + name: Build BFF + uses: iris-connect/iris-client/.github/workflows/bff_develop.yml@chore/optimized_build + + publish-test-results: + name: Publish Test Results + needs: bff + uses: iris-connect/iris-client/.github/workflows/publish-test-results.yml@develop + + fe: + name: Build FE + uses: iris-connect/iris-client/.github/workflows/fe_develop.yml@chore/optimized_build + + e2e_test: + name: Run E2E Tests + needs: bff + uses: iris-connect/iris-client/.github/workflows/fe-e2e-test.yml@chore/optimized_build + + container_scan: + name: Container Scan + needs: [bff, fe] + uses: iris-connect/iris-client/.github/workflows/trivy-container-scan.yml@develop + with: + image-refs: "[ '${{needs.bff.outputs.image-ref}}', '${{needs.fe.outputs.image-ref}}' ]" diff --git a/.github/workflows/fe-e2e-test.yml b/.github/workflows/fe-e2e-test.yml index 8f8c59e7f..56b4487be 100644 --- a/.github/workflows/fe-e2e-test.yml +++ b/.github/workflows/fe-e2e-test.yml @@ -5,15 +5,32 @@ on: branches: - main - release - - develop - 1.** - pull_request: - branches: - - develop + workflow_call: jobs: + pre_job: + name: Determines job skipping + # continue-on-error: true # Uncomment once integration is finished + runs-on: ubuntu-latest + # Map a step output to a job output + outputs: + should_skip: ${{ steps.skip_check.outputs.should_skip }} + steps: + - id: skip_check + uses: fkirc/skip-duplicate-actions@master + with: + # All of these options are optional, so you can remove them if you are happy with the defaults + skip_after_successful_duplicate: 'true' + concurrent_skipping: 'never' + cancel_others: 'true' + paths_ignore: '["**/README.md", "**/docs/**", "**/postman/**", ".reuse/**", "infrastructure/**", "LICENSES/**", "iris-client-eps/**"]' + cypress-run: - runs-on: ubuntu-20.04 + name: Run Cypress E2E Tests + needs: pre_job + if: ${{ needs.pre_job.outputs.should_skip != 'true' }} + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2.4.0 diff --git a/.github/workflows/fe_develop.yml b/.github/workflows/fe_develop.yml index ebdd3a009..cea1ef613 100644 --- a/.github/workflows/fe_develop.yml +++ b/.github/workflows/fe_develop.yml @@ -1,19 +1,31 @@ name: FE Develop on: - push: - branches: - - develop - paths: - - iris-client-fe/** - - .github/workflows/fe_develop.yml - pull_request: - branches: - - develop + workflow_call jobs: + pre_job: + name: Determines job skipping + # continue-on-error: true # Uncomment once integration is finished + runs-on: ubuntu-latest + # Map a step output to a job output + outputs: + should_skip: ${{ steps.skip_check.outputs.should_skip }} + steps: + - id: skip_check + uses: fkirc/skip-duplicate-actions@master + with: + # All of these options are optional, so you can remove them if you are happy with the defaults + skip_after_successful_duplicate: 'false' + concurrent_skipping: 'never' + cancel_others: 'true' + paths: '["iris-client-fe/**", ".github/workflows/fe_develop.yml"]' + paths_ignore: '["**/README.md", "**/docs/**", "**/postman/**"]' + build_and_push: name: Build and push to docker.io + needs: pre_job + if: ${{ needs.pre_job.outputs.should_skip != 'true' }} runs-on: ubuntu-latest # Map a step output to a job output @@ -50,10 +62,3 @@ jobs: VUE_APP_BUILD_ID=${{ github.sha }} labels: | iris.client-fe.image.revision=${{ github.sha }} - - container_scan: - name: Container Scan - needs: build_and_push - uses: iris-connect/iris-client/.github/workflows/trivy-container-scan.yml@develop - with: - image-refs: "[ '${{needs.build_and_push.outputs.image-ref}}' ]"