Start implementing the FIRES reference server #9
Workflow file for this run
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: Test Reference Server | |
on: | |
pull_request: | |
push: | |
paths: | |
- "components/fires-server/**" | |
- "package-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@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: npm | |
- name: Install dependencies | |
run: npm ci | |
- name: Check formatting | |
working-directory: "components/fires-server/" | |
run: npm run format:check | |
- name: Lint | |
working-directory: "components/fires-server/" | |
run: npm run lint | |
- name: Typecheck | |
working-directory: "components/fires-server/" | |
run: npm run typecheck | |
test: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:16-alpine | |
env: | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_USER: postgres | |
POSTGRES_DB: fires_test | |
options: >- | |
--health-cmd pg_isready | |
--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: development | |
PORT: 4444 | |
HOST: localhost | |
LOG_LEVEL: info | |
APP_KEY: "test_determinist_key_DO_NOT_USE_IN_PRODUCTION" | |
DATABASE_HOST: 127.0.0.1 | |
DATABASE_PORT: 54321 | |
DATABASE_USER: postgres | |
DATABASE_PASSWORD: postgres | |
DATABASE_DATABASE: fires_test | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: npm | |
- name: Install dependencies | |
run: npm ci | |
- name: Run tests | |
working-directory: "components/fires-server/" | |
run: npm test -- --no-clear |