Merge pull request #2767 from govuk-one-login/dependabot/npm_and_yarn… #6730
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: "Build & Test Application" | |
| # Triggered when: | |
| # - a file, listed below, is pushed to any branch other than `main`, i.e. a feature branch. | |
| # - invoked by another workflow. | |
| on: | |
| push: | |
| paths: | |
| - "src/**" | |
| - "test/**" | |
| - "@types/**" | |
| - "package.json" | |
| - "package-lock.json" | |
| - "tsconfig.json" | |
| - ".github/workflows/build-test-application.yml" | |
| branches-ignore: | |
| - main | |
| workflow_call: | |
| inputs: | |
| gitRef: | |
| required: false | |
| type: string | |
| default: ${{ github.ref }} | |
| jobs: | |
| build_test_application: | |
| name: "Build & Test Application" | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| services: | |
| localstack: | |
| image: localstack/localstack:3.0.0 | |
| env: | |
| SERVICES: kms,sns,dynamodb,sqs,stepfunctions,cloudwatch | |
| LOCALSTACK_HOST: localstack | |
| AWS_DEFAULT_REGION: eu-west-2 | |
| AWS_ACCESS_KEY_ID: na | |
| AWS_SECRET_ACCESS_KEY: na #pragma: allowlist secret | |
| DEBUG: 0 | |
| ports: | |
| - 4566:4566 | |
| steps: | |
| - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # pin@v3 | |
| with: | |
| ref: ${{ inputs.gitRef || github.ref }} | |
| - name: Provision localstack | |
| env: | |
| AWS_DEFAULT_REGION: eu-west-2 | |
| AWS_ACCESS_KEY_ID: na | |
| AWS_SECRET_ACCESS_KEY: na #pragma: allowlist secret | |
| RUNNING_OUTSIDE_DOCKER: true | |
| run: ./localstack/provision.sh | |
| shell: bash | |
| - name: Set up Node | |
| uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # pin@v3 | |
| with: | |
| node-version-file: .nvmrc | |
| - name: Install dependencies defined in package.json as a clean install | |
| run: npm ci | |
| - name: Build app | |
| run: npm run build | |
| - name: Run unit tests | |
| run: npm run test:unit | |
| env: | |
| SUSPICIOUS_ACTIVITY_TOPIC_ARN: arn:aws:sns:eu-west-2:000000000000:SuspiciousActivityTopicArn | |
| - name: Run integration tests | |
| run: npm run test:integration-legacy | |
| - name: Run lint | |
| run: npm run lint | |
| env: | |
| API_BASE_URL: http://localhost:6000/api | |
| AM_API_BASE_URL: http://localhost:5000/api | |
| GOV_ACCOUNTS_PUBLISHING_API_URL: http://localhost:1000/api | |
| GOV_ACCOUNTS_PUBLISHING_API_TOKEN: token | |
| AM_YOUR_ACCOUNT_URL: some url | |
| OIDC_CLIENT_ID: test | |
| OIDC_CLIENT_SCOPES: openid | |
| SESSION_SECRET: secret #pragma: allowlist secret | |
| SESSION_EXPIRY: 3600000 | |
| SESSION_STORE_TABLE_NAME: account-mgmt-frontend-SessionStore | |
| METHOD_MANAGEMENT_BASE_URL: https://method-management-v1-stub.home.build.account.gov.uk/v1 |