Skip to content

Commit

Permalink
chore: test
Browse files Browse the repository at this point in the history
  • Loading branch information
marcellmueller committed Sep 19, 2024
1 parent 1ad433d commit a5dc38f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
NX_AFFECTED_E2E: ${{steps.check-nx-affected.outputs.NX_AFFECTED_E2E}}
RUN_ALL_E2E: ${{ github.head_ref || github.ref_name }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -33,6 +34,8 @@ jobs:
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"
BRANCH_NAME=${{ github.head_ref || github.ref_name }}
echo "RUN_ALL_E2E="$BRANCH_NAME == 'develop' || $BRANCH_NAME == 'main' || $BRANCH_NAME == 'test-e2e-merge'"" >> "$GITHUB_OUTPUT"
working-directory: ./bciers
shell: bash
Expand Down Expand Up @@ -68,30 +71,36 @@ jobs:
check-nx-affected,
]
uses: ./.github/workflows/test-nx-project-e2e.yaml
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
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') || github.ref_name == 'develop' || github.ref_name == 'main' || github.ref_name == 'test-e2e-merge' || github.head_ref == 'develop' || github.head_ref == 'main' || github.head_ref == 'test-e2e-merge'}}
is_nx_affected: ${{contains(needs.check-nx-affected.outputs.NX_AFFECTED_E2E, 'administration') || needs.check-nx-affected.outputs.RUN_ALL_E2E}}
secrets: inherit
test-coam-e2e:
needs: [build-backend, build-dashboard-e2e, build-coam, check-nx-affected]
uses: ./.github/workflows/test-nx-project-e2e.yaml
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
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') || github.ref_name == 'develop' || github.ref_name == 'main' || github.ref_name == 'test-e2e-merge' || github.head_ref == 'develop' || github.head_ref == 'main' || github.head_ref == 'test-e2e-merge'}}
is_nx_affected: ${{contains(needs.check-nx-affected.outputs.NX_AFFECTED_E2E, 'coam') || needs.check-nx-affected.outputs.RUN_ALL_E2E}}
secrets: inherit
test-reporting-e2e:
needs:
[build-backend, build-dashboard-e2e, build-reporting, check-nx-affected]
uses: ./.github/workflows/test-nx-project-e2e.yaml
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
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') || github.ref_name == 'develop' || github.ref_name == 'main' || github.ref_name == 'test-e2e-merge' || github.head_ref == 'develop' || github.head_ref == 'main' || github.head_ref == 'test-e2e-merge'}}
is_nx_affected: ${{contains(needs.check-nx-affected.outputs.NX_AFFECTED_E2E, 'reporting') || needs.check-nx-affected.outputs.RUN_ALL_E2E}}
secrets: inherit
test-registration1-e2e:
needs: [build-backend, build-registration1, check-nx-affected]
Expand All @@ -106,11 +115,13 @@ jobs:
check-nx-affected,
]
uses: ./.github/workflows/test-nx-project-e2e.yaml
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
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') || github.ref_name == 'develop' || github.ref_name == 'main' || github.ref_name == 'test-e2e-merge' || github.head_ref == 'develop' || github.head_ref == 'main' || github.head_ref == 'test-e2e-merge'}}
is_nx_affected: ${{contains(needs.check-nx-affected.outputs.NX_AFFECTED_E2E, 'registration') || needs.check-nx-affected.outputs.RUN_ALL_E2E}}
secrets: inherit
e2e-finalize:
needs:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/test-nx-project-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ jobs:

# Call Happo api and skip the project if it wasn't affected
happo-skip-not-affected:
if: ${{ !inputs.is_nx_affected && github.ref_name != 'develop' && github.ref_name != 'main' && github.ref_name != 'test-e2e-merge' && github.head_ref != 'develop' && github.head_ref != 'main' && github.head_ref != 'test-e2e-merge' }}
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
# use github env GITHUB_REF_NAME instead of github.ref_name to avoid errors when the ref is not a branch
if: ${{ !inputs.is_nx_affected && env.BRANCH_NAME != 'develop' && env.BRANCH_NAME != 'main' && env.BRANCH_NAME != 'test-e2e-merge' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down

0 comments on commit a5dc38f

Please sign in to comment.