Improve workflows #638
Workflow file for this run
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: Test Reference Server | |
| on: | |
| pull_request: | |
| push: | |
| paths: | |
| - ".github/workflows/test-server.yml" | |
| - "components/fires-server/**" | |
| - "pnpm-lock.json" | |
| # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
| # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: false | |
| permissions: | |
| contents: read | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: "pnpm" | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Check formatting | |
| run: pnpm --filter @fedimod/fires-server -r format:check | |
| - name: Lint | |
| run: pnpm --filter @fedimod/fires-server -r lint | |
| - name: Typecheck | |
| run: pnpm --filter @fedimod/fires-server -r typecheck | |
| test: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:18-alpine | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_USER: postgres | |
| POSTGRES_DB: fires_test | |
| options: >- | |
| --health-cmd "pg_isready -U ${POSTGRES_USER}" | |
| --health-interval 10ms | |
| --health-timeout 3s | |
| --health-retries 50 | |
| ports: | |
| # using a non-standard port to support running workflow with act: | |
| # https://nektosact.com/ | |
| - 54321:5432 | |
| env: | |
| TZ: UTC | |
| NODE_ENV: test | |
| HOST: 127.0.0.1 | |
| PORT: 4444 | |
| PUBLIC_URL: https://fires.test/ | |
| LOG_LEVEL: info | |
| APP_KEY: "test_determinist_key_DO_NOT_USE_IN_PRODUCTION" | |
| DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:54321/fires_test | |
| DATABASE_POOL_MAX: 10 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: "pnpm" | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Run migrations | |
| run: pnpm --filter @fedimod/fires-server -r migrate:fresh | |
| - name: Run tests | |
| run: pnpm --filter @fedimod/fires-server -r test |