OLH-4172: analytics for all paths #3002
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: Integration test | |
| permissions: {} | |
| on: | |
| pull_request: | |
| merge_group: | |
| jobs: | |
| integration-test: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: read | |
| timeout-minutes: 30 | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| persist-credentials: false | |
| - name: Set up Node | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e | |
| with: | |
| node-version-file: .nvmrc | |
| - name: Install dependencies | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: npm run install-all | |
| - name: Configure frontend environment | |
| run: | | |
| cd solutions/frontend | |
| cat > .env.integration-tests << 'EOF' | |
| ENVIRONMENT=local | |
| NODE_ENV=production | |
| USE_LOCALSTACK=1 | |
| SESSIONS_SIGNER=localsessionsignerwhichmustbeatleast32chars | |
| SESSIONS_TABLE_NAME=amc-SessionStore | |
| ROOT_DOMAIN=localhost | |
| ROOT_DOMAIN_WITH_ENV=localhost | |
| AWS_REGION=eu-west-2 | |
| LOCALSTACK_ENDPOINT=http://localhost:4566 | |
| LOCAL_KMS_ENDPOINT=http://localhost:4567 | |
| LOCALSTACK_ACCESS_KEY_ID=test | |
| LOCALSTACK_ACCESS_KEY=test | |
| AUTHORIZE_ENDPOINT_URL=http://localhost:6002/authorize | |
| AUTH_CODE_TABLE_NAME=amc-AuthCode | |
| JOURNEY_OUTCOME_TABLE_NAME=amc-JourneyOutcome | |
| AUTH_FRONTEND_URL=https://signin.account.gov.uk | |
| ACCOUNT_DATA_API_URL=http://localhost:6003/account-data-api | |
| ANALYTICS_COOKIE_DOMAIN=localhost | |
| PASSKEYS_RP_ID=localhost | |
| PASSKEYS_RP_NAME="GOV.UK One Login (local)" | |
| PASSKEYS_EXPECTED_ORIGIN=http://localhost:6002 | |
| ACCOUNT_MANAGEMENT_API_URL=http://localhost:6003/account-management-api | |
| GA4_CONTAINER_ID=GTM-KD86CMZ | |
| ANALYTICS_ENABLED=1 | |
| YOUR_SERVICES_URL=https://home.dev.account.gov.uk/your-services | |
| SECURITY_URL=https://home.dev.account.gov.uk/security | |
| CONTACT_URL=https://home.dev.account.gov.uk/contact-gov-uk-one-login | |
| JAR_RSA_ENCRYPTION_KEY_ALIAS=alias/amc-JARRSAEncryptionKey | |
| REPLAY_ATTACK_TABLE_NAME=amc-ReplayAttack | |
| NOTIFICATIONS_QUEUE_URL=http://sqs.eu-west-2.localhost.localstack.cloud:4566/000000000000/amc-NotificationsQueue | |
| AUDIT_EVENTS_QUEUE_URL=http://sqs.eu-west-2.localhost.localstack.cloud:4566/000000000000/amc-TxMASQSProducerAuditEventQueue | |
| EOF | |
| - name: Configure stubs environment | |
| run: | | |
| cd solutions/stubs | |
| cat > .env.integration-tests << 'EOF' | |
| ENVIRONMENT=local | |
| NODE_ENV=production | |
| USE_LOCALSTACK=1 | |
| MOCK_CLIENT_EC_PRIVATE_KEY_SSM_NAME=/amc/MockClientEcPrivateKey | |
| MOCK_CLIENT_EC_PUBLIC_KEY_SSM_NAME=/amc/MockClientEcPublicKey | |
| MOCK_CLIENT_RSA_PRIVATE_KEY_SSM_NAME=/amc/MockClientRsaPrivateKey | |
| MOCK_CLIENT_RSA_PUBLIC_KEY_SSM_NAME=/amc/MockClientRsaPublicKey | |
| JAR_RSA_ENCRYPTION_KEY_ALIAS=alias/amc-JARRSAEncryptionKey | |
| DEFAULT_AUDIENCE=http://localhost:6002/authorize | |
| API_BASE_URL=http://localhost:6004 | |
| ACCESS_TOKEN_ISSUER=http://localhost:6003 | |
| AUTHORIZE_URL=http://localhost:6002/authorize | |
| AWS_REGION=eu-west-2 | |
| LOCALSTACK_ENDPOINT=http://localhost:4566 | |
| LOCAL_KMS_ENDPOINT=http://localhost:4567 | |
| LOCALSTACK_ACCESS_KEY_ID=test | |
| LOCALSTACK_ACCESS_KEY=test | |
| ROOT_DOMAIN=localhost | |
| EOF | |
| - name: Configure API environment | |
| run: | | |
| cd solutions/api | |
| cat > env.integration-tests.json << 'EOF' | |
| { | |
| "Parameters": { | |
| "NODE_OPTIONS": "--enable-source-maps", | |
| "ENVIRONMENT": "local", | |
| "NODE_ENV": "production", | |
| "USE_LOCALSTACK": "1", | |
| "LOCALSTACK_ENDPOINT": "http://account-components-localstack:4566", | |
| "LOCAL_KMS_ENDPOINT": "http://account-components-local-kms:8080", | |
| "LOCALSTACK_ACCESS_KEY_ID": "test", | |
| "LOCALSTACK_ACCESS_KEY": "test" | |
| }, | |
| "ApiTokenLambda": { | |
| "AUTH_TABLE_NAME": "amc-AuthCode", | |
| "REPLAY_ATTACK_TABLE_NAME": "amc-ReplayAttack", | |
| "JWT_SIGNING_KEY_ALIAS": "alias/amc-JWTSigningKey" | |
| }, | |
| "ApiJourneyOutcomeLambda": { | |
| "JWT_SIGNING_KEY_ALIAS": "alias/amc-JWTSigningKey", | |
| "JOURNEY_OUTCOME_TABLE_NAME": "amc-JourneyOutcome" | |
| } | |
| } | |
| EOF | |
| - name: Run integration tests | |
| run: | | |
| cd solutions/integration-tests | |
| touch .env | |
| echo "PRE_OR_POST_DEPLOY=pre" >> .env | |
| echo "PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:3000/" >> .env | |
| npm run test | |
| - name: Upload test results artifact | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a | |
| if: always() | |
| with: | |
| name: integration-test-results | |
| path: solutions/integration-tests/test-results/ | |
| retention-days: 7 |