Skip to content

Fix test failures in parallel execution and add REFRESH_AES_KEY for token encryption #83

Fix test failures in parallel execution and add REFRESH_AES_KEY for token encryption

Fix test failures in parallel execution and add REFRESH_AES_KEY for token encryption #83

Workflow file for this run

name: Pull Request
on:
pull_request:
branches: [ main ]
jobs:
lint-code:
name: Check source code lint
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Use Node.js v22
uses: actions/setup-node@v4
with:
node-version: v22
- name: Get node_modules cache
id: node_modules
uses: actions/cache@v4
with:
path: |
**/node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install dependencies
if: steps.node_modules.outputs.cache-hit != 'true'
run: pnpm install
- name: Run Biome
run: pnpm lint:check
commitlint:
name: Check commits lint
runs-on: ubuntu-22.04
needs: ['lint-code']
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Restore node_modules cache
id: node_modules
uses: actions/cache@v4
with:
path: |
**/node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: pnpm dlx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
test:
name: Run Tests
needs: ['commitlint']
runs-on: ubuntu-latest
env:
USER_SECRET_KEY: ${{secrets.USER_SECRET_KEY_PR}}
REFRESH_SECRET_KEY: ${{secrets.REFRESH_SECRET_KEY_PR}}
REFRESH_AES_KEY: ${{secrets.REFRESH_AES_KEY_PR}}
AUTH_ISSUER: ${{secrets.AUTH_ISSUER}}
OTP_SECRET: ${{secrets.OTP_SECRET_PR}}
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Restore node_modules cache
id: node_modules
uses: actions/cache@v4
with:
path: |
**/node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Run tests
run: |
pnpm test