Skip to content

feat:optipex add pnpm-lock #26

feat:optipex add pnpm-lock

feat:optipex add pnpm-lock #26

Workflow file for this run

name: Tests
on:
push:
branches-ignore: [develop, main]
tags-ignore: ['v*.*.*']
pull_request:
branches: [main]
jobs:
lint:
name: Lint & Type Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Cache node_modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-
- run: npm install --prefer-offline --no-audit
- run: npm run lint
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Cache node_modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-
- run: npm install --prefer-offline --no-audit
- run: npm run test:unit:coverage
- uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-report
path: |
coverage/
test-results/
retention-days: 7
e2e-tests:
name: E2E Tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: test_database
POSTGRES_USER: postgres
POSTGRES_PASSWORD: P@ssw0rd
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Cache node_modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-
- run: npm install --prefer-offline --no-audit
- name: Cache Playwright browsers
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-playwright-
- run: npx playwright install --with-deps
- run: npx playwright test
env:
TEST_DATABASE_URL: postgresql://postgres:P@ssw0rd@localhost:5432/test_database
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 7