[KIWI-2619] - IPR | BE | Migrate unit and integration tests from Jest to Vitest #57
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: Pull Request CI - OIDC Stub | |
| 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: | |
| - '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 | |
| jobs: | |
| run-code-check: | |
| name: Code Checks | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: oidc-stub/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-oidc | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Compile code | |
| run: npm run compile | |
| sam-validate: | |
| name: SAM Validate | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: oidc-stub | |
| 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@v5 | |
| with: | |
| role-to-assume: ${{ secrets.DEV_OIDC_STUB_GH_ACTIONS_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-oidc | |
| - name: SAM Validate | |
| run: sam validate --region ${{ env.AWS_REGION }} -t template.yaml | |
| - name: SAM Build | |
| run: sam build -t template.yaml |