test e2e merge #2091
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is the main workflow which will orchestrate the other workflows: | ||
name: main | ||
on: | ||
push: | ||
branches: [develop, main, test-e2e-merge] | ||
pull_request: | ||
branches: [develop, main] | ||
workflow_dispatch: | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
env: | ||
PGUSER: postgres | ||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | ||
jobs: | ||
check-nx-affected: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
NX_AFFECTED_E2E: ${{steps.check-nx-affected.outputs.NX_AFFECTED_E2E}} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: dev env setup | ||
uses: ./.github/actions/dev-env-setup | ||
- name: check nx affected target e2e:ci projects and save output | ||
id: check-nx-affected | ||
run: | | ||
NX_AFFECTED_E2E=$(yarn nx show projects --affected --with-target e2e:ci --base=origin/develop) | ||
echo "NX_AFFECTED_E2E="$NX_AFFECTED_E2E"" >> "$GITHUB_OUTPUT" | ||
working-directory: ./bciers | ||
shell: bash | ||
build-backend: | ||
uses: ./.github/workflows/build-backend.yaml | ||
build-registration: | ||
uses: ./.github/workflows/build-registration.yaml | ||
build-dashboard: | ||
uses: ./.github/workflows/build-dashboard.yaml | ||
build-dashboard-e2e: | ||
uses: ./.github/workflows/build-dashboard-e2e.yaml | ||
build-registration1: | ||
uses: ./.github/workflows/build-registration1.yaml | ||
build-reporting: | ||
uses: ./.github/workflows/build-reporting.yaml | ||
build-coam: | ||
uses: ./.github/workflows/build-coam.yaml | ||
build-administration: | ||
uses: ./.github/workflows/build-administration.yaml | ||
test-code: | ||
needs: [check-nx-affected] | ||
uses: ./.github/workflows/test-code.yaml | ||
test-backend: | ||
needs: [build-backend, check-nx-affected] | ||
uses: ./.github/workflows/test-backend.yaml | ||
secrets: inherit | ||
test-administration-e2e: | ||
needs: | ||
[ | ||
build-backend, | ||
build-dashboard-e2e, | ||
build-administration, | ||
check-nx-affected, | ||
] | ||
uses: ./.github/workflows/test-nx-project-e2e.yaml | ||
with: | ||
nx_project: administration | ||
nx_app_port: 4001 | ||
image_url: "ghcr.io/bcgov/cas-admin-frontend" | ||
is_nx_affected: ${{contains(needs.check-nx-affected.outputs.NX_AFFECTED_E2E, 'administration') || env.BRANCH_NAME == 'develop' || env.BRANCH_NAME == 'main' || env.BRANCH_NAME == 'test-e2e-merge'}} | ||
Check failure on line 75 in .github/workflows/main.yaml GitHub Actions / mainInvalid workflow file
|
||
secrets: inherit | ||
test-coam-e2e: | ||
needs: [build-backend, build-dashboard-e2e, build-coam, check-nx-affected] | ||
uses: ./.github/workflows/test-nx-project-e2e.yaml | ||
with: | ||
nx_project: coam | ||
nx_app_port: 7000 | ||
image_url: "ghcr.io/bcgov/cas-coam-frontend" | ||
is_nx_affected: ${{contains(needs.check-nx-affected.outputs.NX_AFFECTED_E2E, 'coam') || env.BRANCH_NAME == 'develop' || env.BRANCH_NAME == 'main' || env.BRANCH_NAME == 'test-e2e-merge'}} | ||
secrets: inherit | ||
test-reporting-e2e: | ||
needs: | ||
[build-backend, build-dashboard-e2e, build-reporting, check-nx-affected] | ||
uses: ./.github/workflows/test-nx-project-e2e.yaml | ||
with: | ||
nx_project: reporting | ||
nx_app_port: 5000 | ||
image_url: "ghcr.io/bcgov/cas-rep-frontend" | ||
is_nx_affected: ${{contains(needs.check-nx-affected.outputs.NX_AFFECTED_E2E, 'reporting') || env.BRANCH_NAME == 'develop' || env.BRANCH_NAME == 'main' || env.BRANCH_NAME == 'test-e2e-merge'}} | ||
secrets: inherit | ||
test-registration1-e2e: | ||
needs: [build-backend, build-registration1, check-nx-affected] | ||
uses: ./.github/workflows/test-registration1-e2e.yaml | ||
secrets: inherit | ||
test-registration-e2e: | ||
needs: | ||
[ | ||
build-backend, | ||
build-dashboard-e2e, | ||
build-registration, | ||
check-nx-affected, | ||
] | ||
uses: ./.github/workflows/test-nx-project-e2e.yaml | ||
with: | ||
nx_project: registration | ||
nx_app_port: 4000 | ||
image_url: "ghcr.io/bcgov/cas-reg-frontend" | ||
is_nx_affected: ${{contains(needs.check-nx-affected.outputs.NX_AFFECTED_E2E, 'registration') || env.BRANCH_NAME == 'develop' || env.BRANCH_NAME == 'main' || env.BRANCH_NAME == 'test-e2e-merge'}} | ||
secrets: inherit | ||
e2e-finalize: | ||
needs: | ||
[ | ||
test-administration-e2e, | ||
test-coam-e2e, | ||
test-reporting-e2e, | ||
test-registration-e2e, | ||
test-registration1-e2e, | ||
] | ||
# Run this job only if all the e2e tests are successful or skipped but not on failure. | ||
# This was needed as just the `needs` condition was skipping the entire job if any of the e2e tests were skipped. | ||
if: | | ||
always() && | ||
(needs.test-administration-e2e.result == 'success' || needs.test-administration-e2e.result == 'skipped') && | ||
(needs.test-coam-e2e.result == 'success' || needs.test-coam-e2e.result == 'skipped') && | ||
(needs.test-reporting-e2e.result == 'success' || needs.test-reporting-e2e.result == 'skipped') && | ||
(needs.test-registration-e2e.result == 'success' || needs.test-registration-e2e.result == 'skipped') && | ||
(needs.test-registration1-e2e.result == 'success' || needs.test-registration1-e2e.result == 'skipped') | ||
uses: ./.github/workflows/e2e-finalize.yaml | ||
secrets: inherit | ||
zap-owasp: | ||
# We will need to set up the BCIERS apps to get zap scanned | ||
needs: [build-backend, build-registration1, check-nx-affected] | ||
uses: ./.github/workflows/zap-owasp.yaml | ||
trivy: | ||
uses: ./.github/workflows/trivy.yaml | ||
codeql: | ||
uses: ./.github/workflows/codeql.yaml |