-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (49 loc) · 1.2 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: CI Pipeline
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
name: template
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: postgres
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U test -d postgres"
--health-interval=10s
--health-timeout=5s
--health-retries=5
env:
DATABASE_URL: postgres://test:test@localhost:5432/postgres
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install
- name: Compile typescript
run: bun run compile
- name: Lint
run: bun run lint
- name: Wait for Database
run: |
until pg_isready -h localhost -p 5432 -U test_user -d test_db; do
echo "Waiting for PostgreSQL...";
sleep 3;
done
- name: Run migrations
run: bun run db:migrate
- name: Run tests
run: bun run test:ci