Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
NODE_ENV=test
DB_HOST=localhost
DB_PORT=5434
DB_USER=postgres
DB_PASSWORD=example
71 changes: 71 additions & 0 deletions .github/workflows/server-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Server Tests

on:
pull_request:
# Only trigger when relevant files change to save CI minutes
paths-ignore:
- 'frontend/**'
- '**.md'
- '.gitignore'
- '.editorconfig'
- '**/.eslintrc*'
- '.prettierrc'
- '.prettierignore'
- 'LICENSE'

# Automatically cancel in-progress runs if you push new code to the same PR
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 30

services:
postgres:
image: postgres:14-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: example
POSTGRES_DB: postgres
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 2s
--health-timeout 5s
--health-retries 15
postgres -c wal_level=logical
Comment thread
skwowet marked this conversation as resolved.
Outdated

env:
NODE_ENV: test
DB_HOST: localhost
DB_PORT: 5432
DB_USER: postgres
DB_PASSWORD: example

steps:
- name: Check out repository code
uses: actions/checkout@v4

- name: Setup Node and cache pnpm
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm' # Built-in caching for faster runs

- name: Install dependencies
run: |
corepack enable
pnpm i --frozen-lockfile

- name: Prepare test database
run: SEQUIN_BOOTSTRAP=1 ./scripts/prepare-test-template-db.sh

- name: Run server tests
run: pnpm test:server
Comment thread
skwowet marked this conversation as resolved.
2 changes: 0 additions & 2 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
"dotenv": "8.2.0",
"dotenv-expand": "^8.0.3",
"emoji-dictionary": "^1.0.11",
"erlpack": "^0.1.4",
"express": "4.17.1",
"express-oauth2-jwt-bearer": "^1.7.4",
"express-rate-limit": "6.5.1",
Expand Down Expand Up @@ -132,7 +131,6 @@
"uuid": "^9.0.0",
"validator": "^13.7.0",
"verify-github-webhook": "^1.0.1",
"zlib-sync": "^0.1.8",
"zod": "^4.3.6"
},
"private": true,
Expand Down
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
{
"private": true,
"scripts": {
"prepare": "husky"
"prepare": "husky",
"test": "vitest run",
"test:server": "vitest run --project server",
"test:changed": "vitest --changed",
"test:watch": "vitest"
},
"devDependencies": {
"@commitlint/cli": "^19.8.0",
"@commitlint/config-conventional": "^19.8.0",
"husky": "^9.1.7"
"husky": "^9.1.7",
"vite": "6.3.5",
"vitest": "4.1.7"
},
"packageManager": "pnpm@9.11.0+sha512.0a203ffaed5a3f63242cd064c8fb5892366c103e328079318f78062f24ea8c9d50bc6a47aa3567cabefd824d170e78fa2745ed1f16b132e16436146b7688f19b"
}
Loading