Skip to content

Commit 19fa92d

Browse files
committed
Add server tests
1 parent eff962a commit 19fa92d

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

.github/workflows/server-test.yml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Server Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
pull_request:
9+
branches:
10+
- main
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
test:
18+
name: Server Typecheck, Lint, and Tests
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 5
21+
22+
services:
23+
postgres:
24+
image: postgres:15
25+
env:
26+
POSTGRES_USER: postgres
27+
POSTGRES_PASSWORD: postgres
28+
POSTGRES_DB: test_db
29+
ports:
30+
- 5432:5432
31+
options: >-
32+
--health-cmd pg_isready
33+
--health-interval 10s
34+
--health-timeout 5s
35+
--health-retries 5
36+
37+
steps:
38+
- uses: actions/checkout@v4
39+
40+
- name: Setup Bun
41+
uses: oven-sh/setup-bun@v2
42+
43+
- name: Install dependencies
44+
run: bun install
45+
46+
- name: Setup environment
47+
run: |
48+
echo "DATABASE_URL=postgres://postgres:postgres@localhost:5432/test_db" >> $GITHUB_ENV
49+
50+
- name: Run database migrations
51+
run: bun db:migrate
52+
53+
- name: Run tests
54+
run: bun test
55+
56+
- name: Run linter
57+
run: bun lint
58+
59+
- name: Type check
60+
run: bun typecheck
61+
62+
- name: Cache dependencies
63+
uses: actions/cache@v4
64+
with:
65+
path: |
66+
~/.bun/install/cache
67+
node_modules
68+
.eslintcache
69+
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
70+
restore-keys: |
71+
${{ runner.os }}-bun-

0 commit comments

Comments
 (0)