Skip to content

fix(security): consolidate email regex, shell executor, CSRF token pa… #2937

fix(security): consolidate email regex, shell executor, CSRF token pa…

fix(security): consolidate email regex, shell executor, CSRF token pa… #2937

Workflow file for this run

name: Test Suite
on:
push:
branches: [main, master, develop]
pull_request:
branches: [main, master, develop]
workflow_dispatch:
env:
NODE_VERSION: '22'
jobs:
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres:17-alpine
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: pagespace_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:7-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v6
- name: Install pnpm
uses: pnpm/action-setup@v5
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build packages
run: pnpm build
- name: Generate migrations
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/pagespace_test
run: pnpm db:generate
- name: Setup test database
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/pagespace_test
JWT_SECRET: test-secret-key-minimum-32-characters-long-for-ci
JWT_ISSUER: pagespace-test
JWT_AUDIENCE: pagespace-test-users
run: pnpm --filter @pagespace/db db:migrate
- name: Run tests with coverage
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/pagespace_test
REDIS_URL: redis://localhost:6379
REDIS_SESSION_URL: redis://localhost:6379/0
REDIS_RATE_LIMIT_URL: redis://localhost:6379/1
JWT_SECRET: test-secret-key-minimum-32-characters-long-for-ci
JWT_ISSUER: pagespace-test
JWT_AUDIENCE: pagespace-test-users
run: pnpm test:coverage
- name: Coverage report
if: always()
run: node scripts/coverage-report.mjs
- name: Upload coverage artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-reports
path: |
apps/*/coverage/coverage-summary.json
packages/*/coverage/coverage-summary.json
retention-days: 30
lint:
name: Lint & TypeScript Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install pnpm
uses: pnpm/action-setup@v5
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run ESLint
run: pnpm lint
- name: Run TypeScript check
run: pnpm typecheck