chore: restore deleted QueueWorkCommand #105
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: CI | |
| on: | |
| push: | |
| branches: [main, staging, production] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| # One run per ref; cancel superseded runs on the same branch/PR. | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint-typecheck: | |
| name: Lint, typecheck & build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: pnpm/action-setup@v6 | |
| with: | |
| version: 10.28.2 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - name: Build libraries | |
| run: pnpm run build:libs | |
| - name: Lint | |
| run: pnpm run lint | |
| - name: Typecheck | |
| run: pnpm run typecheck | |
| test: | |
| name: Tests | |
| runs-on: ubuntu-latest | |
| # The API integration tests need a real Postgres. Matches the DATABASE_URL in | |
| # apps/api/.env.example (postgres:postgres@localhost:5432/arkstark_test). | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: arkstark_test | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U postgres" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 10 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: pnpm/action-setup@v6 | |
| with: | |
| version: 10.28.2 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| # The libs are imported at runtime via their built `dist/`, so build them | |
| # before running any package or API test. | |
| - name: Build libraries | |
| run: pnpm run build:libs | |
| - name: Configure API test env | |
| run: | | |
| cp apps/api/.env.example apps/api/.env | |
| # A deterministic 32-byte app key (JWT signing, 2FA encryption, sessions). | |
| sed -i 's|^APP_KEY=.*$|APP_KEY=ci-test-app-key-0123456789abcdef|' apps/api/.env | |
| - name: Run database migrations | |
| working-directory: apps/api | |
| run: pnpm ark migrate | |
| - name: Run library & app tests | |
| # Every @arkyc/* package except the API (run separately below). Filtering | |
| # by the scope skips the unscoped root package, whose own `test` script | |
| # would otherwise re-run recursively and double the `--pass-with-no-tests`. | |
| run: pnpm --filter '@arkyc/*' --filter '!@arkyc/api' run test --pass-with-no-tests | |
| - name: Run API tests | |
| working-directory: apps/api | |
| # Single-threaded: the suite shares one Postgres + app process, so file | |
| # parallelism causes cross-test contention. | |
| run: pnpm exec vitest run --no-file-parallelism |