Skip to content

[KIWI-2619] - IPR | BE | Migrate unit and integration tests from Jest to Vitest #1469

[KIWI-2619] - IPR | BE | Migrate unit and integration tests from Jest to Vitest

[KIWI-2619] - IPR | BE | Migrate unit and integration tests from Jest to Vitest #1469

Workflow file for this run

name: Pull Request CI
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/**'
- 'test-harness/**'
- 'gov-notify-stub/**'
- 'oidc-stub/**'
# 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
SIGNING_KEY_ID: 1234-56789-KeyId
JWKS_BUCKET_NAME: test
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@v6
with:
submodules: true
- name: Setup nodeJS v22
uses: actions/setup-node@v6
with:
node-version: 22
- 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@v5
with:
path: ${{ steps.offline-mirror-path.outputs.mirror-dir }}
key: offline-mirror-oauth
- name: Install dependencies
run: npm ci
- name: Run lint
run: npm run lint
- name: Archive lint results
if: always()
uses: actions/upload-artifact@v7
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
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@v6
with:
submodules: true
- name: Setup SAM CLI
uses: aws-actions/setup-sam@v3
with:
use-installer: true
- name: Assume temporary AWS role
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: ${{ secrets.GH_RETURN_VALIDATE_ROLE_ARN }}
aws-region: ${{ env.AWS_REGION }}
- name: Cache SAM builds
uses: actions/cache@v5
with:
path: |
./di-ipv-cri-ipr-api/.aws-sam/cache
./di-ipv-cri-ipr-api/.aws-sam/deps
./di-ipv-cri-ipr-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
pre-merge-checks:
uses: ./.github/workflows/pre-merge-checks.yml
secrets: inherit