BAU: Bump @types/node from 18.13.0 to 20.12.12 in /src #1406
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
name: Pull Request CI - Backend API | |
on: | |
# Triggers the workflow on push or pull request events but only for the "main" or "develop" branch | |
pull_request: | |
branches: | |
- main | |
types: | |
- opened | |
- reopened | |
- ready_for_review | |
- synchronize | |
paths-ignore: | |
- 'infra-l2-dynamo/**' | |
- 'infra-l2-kms/**' | |
- 'cic-ipv-stub/**' | |
- 'test-harness/**' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# Required for sam-validate step | |
permissions: | |
id-token: write | |
contents: read | |
env: # Only adding the variables in that are required for | |
AWS_REGION: eu-west-2 | |
DEV_CRI_CIC_API_URL: ${{ secrets.DEV_CRI_CIC_API_URL }} | |
DEV_IPV_STUB_URL: ${{ secrets.DEV_IPV_STUB_URL }} | |
PACT_BROKER_USER: ${{ secrets.PACT_BROKER_USER }} | |
PACT_BROKER_PASSWORD: ${{ secrets.PACT_BROKER_PASSWORD }} | |
PACT_BROKER_URL: ${{ secrets.PACT_BROKER_URL }}?testSource=${{ secrets.PACT_BROKER_SOURCE_HEADER }} | |
PACT_PROVIDER_NAME: ${{ secrets.PACT_PROVIDER_NAME }} | |
PACT_PROVIDER_VERSION: ${{ secrets.PACT_PROVIDER_VERSION }} | |
jobs: | |
run-code-check: | |
name: Code Checks | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
working-directory: ./src/ | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Checks if commiting secrets to repo | |
uses: pre-commit/action@v3.0.1 | |
with: | |
extra_args: "detect-secrets --all-files" | |
- name: Setup nodeJS v18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Set offline mirror path | |
id: offline-mirror-path | |
run: echo "mirror-dir=${GITHUB_WORKSPACE}/npm-packages-offline-cache" >> $GITHUB_OUTPUT | |
- name: Cache npm offline-mirror | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.offline-mirror-path.outputs.mirror-dir }} | |
key: offline-mirror-oauth | |
- name: Install dependencies | |
run: npm install | |
- name: Run lint | |
run: npm run lint | |
- name: Archive lint results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: lint-report | |
path: src/reports/eslint/reportFile.html | |
- name: Run Tests | |
run: npm run test:unit | |
- name: Run Infra checks | |
run: npm run test:infra | |
- name: Run Contract tests | |
run: npm run test:contract:ci | |
- name: Kill DynamoDB | |
run: npm run kill:dynamodblocal | |
sam-validate: | |
name: SAM Validate | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
working-directory: ./deploy/ | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Setup SAM CLI | |
uses: aws-actions/setup-sam@v2 | |
with: | |
use-installer: true | |
- name: Assume temporary AWS role | |
uses: aws-actions/configure-aws-credentials@v4.0.2 | |
with: | |
role-to-assume: ${{ secrets.CRI_CIC_GH_VALIDATE_ROLE_ARN }} | |
aws-region: ${{ env.AWS_REGION }} | |
- name: Cache SAM builds | |
uses: actions/cache@v4 | |
with: | |
path: | | |
./di-ipv-cri-cic-api/.aws-sam/cache | |
./di-ipv-cri-cic-api/.aws-sam/deps | |
./di-ipv-cri-cic-api/.aws-sam/build.toml | |
key: sam-oauth | |
- name: SAM Validate | |
run: sam validate --region ${{ env.AWS_REGION }} -t template.yaml | |
- name: SAM Build | |
run: sam build -t template.yaml |