Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(build): test umbrella job to build the client in a coordinated … #459

Draft
wants to merge 32 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
72c10ea
chore(build): test umbrella job to build the client in a coordinated …
jekutzsche Nov 9, 2021
b2061fb
chore(build): test expressions for if
jekutzsche Nov 9, 2021
246032a
chore(build): test expressions for if 2
jekutzsche Nov 9, 2021
900e104
chore(build): moves tag determination do head workflow
jekutzsche Nov 9, 2021
b8cea52
chore(build): test expressions for if 3
jekutzsche Nov 9, 2021
ceeffe5
chore(build): moves tag determination do head workflow 2
jekutzsche Nov 9, 2021
889f226
chore(build): test expressions for if 4
jekutzsche Nov 9, 2021
b5a939d
chore(build): moves tag determination do head workflow 3
jekutzsche Nov 9, 2021
6043099
chore(build): test expressions for if 5
jekutzsche Nov 9, 2021
79c9962
chore(build): moves tag determination do head workflow 4
jekutzsche Nov 9, 2021
c7c19af
chore(build): moves tag determination do head workflow 5
jekutzsche Nov 9, 2021
0c8d8a8
chore(build): test if for e2e
jekutzsche Nov 9, 2021
e4891f0
chore(build): moves tag determination do head workflow 6
jekutzsche Nov 9, 2021
a662ac2
chore(build): moves tag determination do head workflow 7
jekutzsche Nov 9, 2021
71b67cc
chore(build): moves if condition to head workflow
jekutzsche Nov 9, 2021
fbbe4df
chore(build): moves if condition to head workflow 2
jekutzsche Nov 9, 2021
b5c6192
chore(build): moves pre jobs to head workflow
jekutzsche Nov 9, 2021
63f7e83
chore(build): moves pre jobs to head workflow 2
jekutzsche Nov 9, 2021
210b76c
chore(build): test run
jekutzsche Nov 9, 2021
b6ec8b3
chore(build): test run 3
jekutzsche Nov 9, 2021
bbe62d3
chore(build): test run 4
jekutzsche Nov 9, 2021
fd6bd84
chore(build): test run 5
jekutzsche Nov 9, 2021
ba6c6c8
chore(build): test run 6
jekutzsche Nov 9, 2021
79524b2
chore(build): test run 7
jekutzsche Nov 9, 2021
658a765
chore(build): moves pre jobs to head workflow for FEr
jekutzsche Nov 10, 2021
700c6b5
chore: test for edit tag array
jekutzsche Nov 19, 2021
23a0d30
chore: test for edit tag array 2
jekutzsche Nov 19, 2021
8aa93a1
chore: test for edit tag array 3
jekutzsche Nov 19, 2021
6d0d3ad
chore: test for edit tag array 4
jekutzsche Nov 19, 2021
f8bdb2d
chore: test for edit tag array 5
jekutzsche Nov 19, 2021
f88b5a8
chore: test for edit tag array 6
jekutzsche Nov 19, 2021
60c3c22
chore: sets prefix to sub-workflows to clarify their difference
jekutzsche Nov 20, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/app-eps_develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ jobs:
container_scan:
name: Container Scan
needs: build_and_push
uses: iris-connect/iris-client/.github/workflows/trivy-container-scan.yml@develop
uses: iris-connect/iris-client/.github/workflows/sub.trivy-container-scan.yml@develop
with:
image-refs: "[ '${{needs.build_and_push.outputs.image-ref}}' ]"
123 changes: 123 additions & 0 deletions .github/workflows/client_develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: Client Develop

on:
push:
branches:
- develop
pull_request:
branches:
- develop
- main

jobs:
skip_check:
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_bff: ${{ steps.skip_check_bff.outputs.should_skip }}
should_skip_fe: ${{ steps.skip_check_fe.outputs.should_skip }}
steps:
- id: skip_check_bff
name: Skip Check BFF
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'
cancel_others: 'true'
paths_ignore: '["**/README.md", "**/Readme.md", "**/docs/**", "**/postman/**"]'
paths: '[".github/workflows/sub.bff_develop.yml", "iris-client-bff/**"]'

- id: skip_check_fe
name: Skip Check FE
uses: fkirc/skip-duplicate-actions@master
with:
skip_after_successful_duplicate: 'false'
cancel_others: 'true'
paths_ignore: '["**/README.md", "**/Readme.md", "**/docs/**", "**/postman/**"]'
paths: '[".github/workflows/sub.fe_develop.yml", "iris-client-fe/**"]'

determine_images:
name: Determines Relevant Images
needs: skip_check
runs-on: ubuntu-latest
outputs:
images: ${{ env.IMAGES }}
steps:
- id: step
name: Determines Relevant Images
run: |
declare -a image_array

if [ ${{ needs.skip_check.outputs.should_skip_bff }} != 'true' ]; then
image_array+=(inoeg/iris-client-bff)
fi
if [ ${{ needs.skip_check.outputs.should_skip_fe }} != 'true' ]; then
image_array+=(inoeg/iris-client-frontend)
fi

echo "IMAGES=$(IFS=,; echo "${image_array[*]}")" >> $GITHUB_ENV
# echo "tags=$(echo $IMAGE_JSON | jq -c '[.tags[] | select(test("bff|fr"))]')" >> $GITHUB_ENV

determine_tag:
name: Determines Image Tag
needs: determine_images
if: ${{ needs.determine_images.outputs.images != '' }}
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
image_tag: ${{ steps.step.outputs.version }}
image_json: ${{ steps.step.outputs.json }}
steps:
- name: Determines Image Tag
id: step
uses: docker/metadata-action@v3
with:
images: ${{needs.determine_images.outputs.images}}

bff:
name: Build BFF
needs: [skip_check, determine_tag]
if: ${{ needs.skip_check.outputs.should_skip_bff != 'true' }}
uses: iris-connect/iris-client/.github/workflows/sub.bff_develop.yml@chore/optimized_build
with:
image_tag: ${{needs.determine_tag.outputs.image_tag}}
secrets:
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
DOCKER_HUB_PW: ${{ secrets.DOCKER_HUB_PW }}

publish-test-results:
name: Publish Test Results
needs: bff
# the previous job might be skipped, we don't need to run this job then
if: success() || failure()
uses: iris-connect/iris-client/.github/workflows/sub.publish-test-results.yml@chore/optimized_build

fe:
name: Build FE
needs: [skip_check, determine_tag]
if: ${{ needs.skip_check.outputs.should_skip_fe != 'true' }}
uses: iris-connect/iris-client/.github/workflows/sub.fe_develop.yml@chore/optimized_build
with:
image_tag: ${{needs.determine_tag.outputs.image_tag}}
secrets:
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
DOCKER_HUB_PW: ${{ secrets.DOCKER_HUB_PW }}

e2e_test:
name: Run E2E Tests
needs: [bff, fe]
if: ${{ !failure() && !cancelled() && (success('bff') || success('fe')) }}
# if: ${{ always() && contains(needs.*.result, 'success') && !(contains(needs.*.result, 'failure')) }}
# from: https:munity/t/run-a-job-if-at-least-one-of-the-previous-ones-succeeded/163777/2
# Does not work! See also for the solution above: https:/actions/runner/issues/491
uses: iris-connect/iris-client/.github/workflows/sub.fe-e2e-test.yml@chore/optimized_build

container_scan:
name: Container Scan
needs: [determine_tag, bff, fe]
if: ${{ !failure() && !cancelled() }}
uses: iris-connect/iris-client/.github/workflows/sub.trivy-container-scan.yml@chore/optimized_build
with:
image-refs: ${{ toJSON(fromJSON(needs.determine_tag.outputs.image_json).tags) }}
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "CodeQL"
name: CodeQL

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/iris-client-eps_develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ jobs:
container_scan:
name: Container Scan
needs: build_and_push
uses: iris-connect/iris-client/.github/workflows/trivy-container-scan.yml@develop
uses: iris-connect/iris-client/.github/workflows/sub.trivy-container-scan.yml@develop
with:
image-refs: "[ '${{needs.build_and_push.outputs.image-ref}}' ]"
2 changes: 1 addition & 1 deletion .github/workflows/iris-client-proxy_develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ jobs:
container_scan:
name: Container Scan
needs: build_and_push
uses: iris-connect/iris-client/.github/workflows/trivy-container-scan.yml@develop
uses: iris-connect/iris-client/.github/workflows/sub.trivy-container-scan.yml@develop
with:
image-refs: "[ '${{needs.build_and_push.outputs.image-ref}}' ]"
2 changes: 1 addition & 1 deletion .github/workflows/nginx_develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ jobs:
container_scan:
name: Container Scan
needs: build_and_push
uses: iris-connect/iris-client/.github/workflows/trivy-container-scan.yml@develop
uses: iris-connect/iris-client/.github/workflows/sub.trivy-container-scan.yml@develop
with:
image-refs: "[ '${{needs.build_and_push.outputs.image-ref}}' ]"
13 changes: 7 additions & 6 deletions .github/workflows/release-gitflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ on:
- next
- next-major
- 1.**

defaults:
run:
shell: bash

jobs:
release-client:
Expand Down Expand Up @@ -82,11 +78,16 @@ jobs:
publish-test-results:
name: Publish Test Results
needs: release-client
uses: iris-connect/iris-client/.github/workflows/publish-test-results.yml@develop
uses: iris-connect/iris-client/.github/workflows/sub.publish-test-results.yml@develop

e2e_test:
name: Run E2E Tests
needs: release-client
uses: iris-connect/iris-client/.github/workflows/sub.fe-e2e-test.yml@chore/optimized_build

container_scan:
name: Container Scan
needs: release-client
uses: iris-connect/iris-client/.github/workflows/trivy-container-scan.yml@develop
uses: iris-connect/iris-client/.github/workflows/sub.trivy-container-scan.yml@develop
with:
image-refs: "[ 'inoeg/iris-client-bff:latest', 'inoeg/iris-client-frontend:latest', 'inoeg/iris-client-nginx:latest', 'inoeg/iris-client-eps:latest', 'inoeg/iris-client-proxy:latest', 'inoeg/app-eps:latest']"
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,23 @@
name: BFF Develop

on:
push:
branches:
- develop
paths:
- iris-client-bff/**
- .github/workflows/bff_develop.yml
pull_request:
branches:
- develop

defaults:
run:
shell: bash
workflow_call:
inputs:
image_tag:
description: 'Tag that will be added to the image name'
required: true
type: string
secrets:
DOCKER_HUB_USER:
required: true
DOCKER_HUB_PW:
required: true

jobs:
build_and_push:
name: Build and push to docker.io
runs-on: ubuntu-latest

# Map a step output to a job output
outputs:
image-ref: ${{ steps.meta.outputs.tags }}

steps:
- name: Checkout code
uses: actions/[email protected]
Expand All @@ -45,15 +39,9 @@ jobs:
restore-keys: |
${{ runner.os }}-maven-

- name: Create image tag
id: meta
uses: docker/metadata-action@v3
with:
images: inoeg/iris-client-bff

- name: build, package and publish the image
run: |
mvn -B clean verify spring-boot:build-image -am -pl iris-client-bff -Dspring-boot.build-image.publish=true -Dversion.tag=${{ steps.meta.outputs.version }}
mvn -B clean verify spring-boot:build-image -am -pl iris-client-bff -Dspring-boot.build-image.publish=true -Dversion.tag=${{ inputs.image_tag }}
env:
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
DOCKER_HUB_PW: ${{ secrets.DOCKER_HUB_PW }}
Expand All @@ -67,15 +55,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}}' ]"
Original file line number Diff line number Diff line change
@@ -1,19 +1,32 @@
name: FE e2e Test

on:
push:
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: ${{ always() && contains(needs.*.result, 'success') && !contains(needs.*.result, 'failure') }}
# || needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
name: FE Develop

on:
push:
branches:
- develop
paths:
- iris-client-fe/**
- .github/workflows/fe_develop.yml
pull_request:
branches:
- develop
workflow_call:
inputs:
image_tag:
description: 'Tag that will be added to the image name'
required: true
type: string
secrets:
DOCKER_HUB_USER:
required: true
DOCKER_HUB_PW:
required: true

jobs:
build_and_push:
name: Build and push to docker.io
runs-on: ubuntu-latest

# Map a step output to a job output
outputs:
image-ref: ${{ steps.meta.outputs.tags }}
env:
tags: inoeg/iris-client-frontend:${{ inputs.image_tag }}

steps:
- name: Check out the repo
Expand All @@ -27,12 +28,6 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Create image tag
id: meta
uses: docker/metadata-action@v3
with:
images: inoeg/iris-client-frontend

- name: Login to DockerHub
uses: docker/login-action@v1
with:
Expand All @@ -43,17 +38,10 @@ jobs:
uses: docker/[email protected]
with:
context: ./iris-client-fe/
tags: ${{ steps.meta.outputs.tags }}
tags: ${{ env.tags }}
push: true
build-args: |
VUE_APP_VERSION_ID=${{ steps.meta.outputs.tags }}
VUE_APP_VERSION_ID=${{ env.tags }}
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}}' ]"
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ jobs:
name: Download and Publish
runs-on: ubuntu-latest

# the previous job might be skipped, we don't need to run this job then
if: success() || failure()

steps:
- name: Download Artifact
uses: actions/download-artifact@v2
Expand Down
Loading