Skip to content
6 changes: 3 additions & 3 deletions .github/workflows/lint-and-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
with:
node-version: latest
cache: "npm"
- name: Install Packages
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Lint
run: npm run lint
Expand All @@ -31,7 +31,7 @@ jobs:
with:
node-version: latest
cache: "npm"
- name: Install Packages
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Typecheck
run: npm run typecheck
Expand All @@ -44,7 +44,7 @@ jobs:
with:
node-version: latest
cache: "npm"
- name: Install Packages
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Format
run: npm run format
45 changes: 45 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Tests / Backend
on:
pull_request:
branches:
- main

jobs:
postgres-container:
runs-on: ubuntu-latest
env:
PGUSER: postgres
PGPASSWORD: password
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wasn't sure how secrets worked with forked repos but we can probably figure this out and move this to a secret

PGHOST: db
PGDATABASE: safeskiesdb
PGPORT: 5432
HUSKY: 0
container: node:22.14-bookworm-slim

services:
db:
image: postgres
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: password
POSTGRES_DB: safeskiesdb
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22.14.0
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Run migrations
run: npm run migrate:up
- name: Run tests
run: npm run test
Loading