Add Totp Library for Two-Factor Authentication (2FA) Support #53
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 | |
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}} | |
AUTH_ISSUER: ${{secrets.AUTH_ISSUER}} | |
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 |