AMCR-472: Update compliance scheme cancellation email template IDs #876
Workflow file for this run
This file contains hidden or 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
| name: Check Pull Request | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| types: | |
| - opened | |
| - edited | |
| - reopened | |
| - synchronize | |
| - ready_for_review | |
| workflow_dispatch: | |
| jobs: | |
| pr-validator: | |
| name: Run Pull Request Checks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v7 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: 22 | |
| - name: Run journey-test Compose helper tests | |
| run: node --test compose/journey-tests/generate-wiremock-mappings.test.mjs | |
| - name: Test | |
| uses: actions/setup-dotnet@v6 | |
| with: | |
| dotnet-version: | | |
| 10.0 | |
| - name: Run unit tests | |
| run: | | |
| dotnet test --filter "Category!=IntegrationTests" | |
| - name: Run integration tests | |
| env: | |
| GOVUKNOTIFY_APIKEY: ${{ secrets.GOVUKNOTIFY_APIKEY }} | |
| run: | | |
| set -o pipefail | |
| docker compose up -d --wait | |
| test_log="$RUNNER_TEMP/integration-tests.log" | |
| set +e | |
| dotnet test \ | |
| --filter "Category=IntegrationTests" \ | |
| --logger "console;verbosity=normal" 2>&1 | tee "$test_log" | |
| test_exit_code=${PIPESTATUS[0]} | |
| set -e | |
| if grep -Fq "GOVUKNOTIFY_APIKEY is not set" "$test_log"; then | |
| echo "❌ GOVUKNOTIFY_APIKEY warning found in test output" | |
| exit 1 | |
| fi | |
| if [ "$test_exit_code" -ne 0 ]; then | |
| echo "::error title=Integration tests failed::dotnet test exited with code $test_exit_code." | |
| exit "$test_exit_code" | |
| fi | |
| - name: Focused Docker diagnostics | |
| if: failure() | |
| run: | | |
| docker compose ps | |
| for service in api wiremock mongodb; do | |
| echo "::group::$service errors" | |
| docker compose logs --no-color --tail=100 "$service" \ | |
| | grep -Eai -C 3 '\[EROR\]|\[FATAL\]|UnhandledException|exception|fail' || true | |
| echo "::endgroup::" | |
| done | |
| - name: Check Dockerfile Builds | |
| uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| push: false | |
| tags: waste-obligations:latest | |
| - name: Check with Trivy | |
| run: docker run -v /var/run/docker.sock:/var/run/docker.sock aquasec/trivy:0.69.3 image waste-obligations:latest --ignore-unfixed | |
| - name: Check openapi with Vacuum | |
| run: make lint-openapi | |
| - name: Store openapi artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: openapi.json | |
| path: src/Api/openapi.json | |
| sonarcloud-scan: | |
| name: CDP SonarCloud Scan | |
| uses: ./.github/workflows/sonarcloud.yml | |
| secrets: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| journey-tests: | |
| name: Run journey tests | |
| # Dependabot-triggered workflows cannot access the Actions secrets required by E2E journeys. | |
| if: github.actor != 'dependabot[bot]' && (github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Resolve journey-test branch | |
| id: journey-tests-ref | |
| shell: bash | |
| env: | |
| JOURNEY_TESTS_BRANCH: ${{ github.head_ref || github.ref_name }} | |
| run: | | |
| branch="$JOURNEY_TESTS_BRANCH" | |
| if git ls-remote --exit-code --heads https://github.com/DEFRA/waste-obligations-journey-tests.git "$branch" > /dev/null; then | |
| echo "ref=$branch" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "ref=main" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Checkout selected journey-test action | |
| uses: actions/checkout@v7 | |
| with: | |
| repository: DEFRA/waste-obligations-journey-tests | |
| ref: ${{ steps.journey-tests-ref.outputs.ref }} | |
| path: journey-tests-action | |
| - name: Run journey profiles | |
| uses: ./journey-tests-action/run-journey-tests | |
| with: | |
| journey-tests-ref: ${{ steps.journey-tests-ref.outputs.ref }} | |
| waste-obligations: ${{ github.event.pull_request.head.sha || github.sha }} | |
| env: | |
| EPR_USER_EMAIL: ${{ secrets.EPR_USER_EMAIL }} | |
| EPR_USER_PASSWORD: ${{ secrets.EPR_USER_PASSWORD }} | |
| EPR_CSO_USER_EMAIL: ${{ secrets.EPR_CSO_USER_EMAIL }} | |
| EPR_CSO_USER_PASSWORD: ${{ secrets.EPR_CSO_USER_PASSWORD }} | |
| WASTE_OBLIGATION_ORG_ID: e2316c5e-d434-41da-8274-494dc0762d20 | |
| WASTE_OBLIGATION_CSO_ORG_ID: d93376e3-0681-46be-aeb4-7450a2e784d8 | |
| WASTE_OBLIGATION_SUBMITTER_ID: 98b1e75b-5f36-4d0e-91ae-84fe9b6ce794 | |
| WASTE_OBLIGATION_SUBMITTER_EMAIL: submitter@example.com | |
| WASTE_OBLIGATIONS_FRONTEND_B2C_CLIENT_SECRET: ${{ secrets.WASTE_OBLIGATIONS_FRONTEND_B2C_CLIENT_SECRET }} | |
| GOVUK_NOTIFY_API_KEY: ${{ secrets.GOVUK_NOTIFY_API_KEY }} |