-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (61 loc) · 1.93 KB
/
Copy pathci.yml
File metadata and controls
72 lines (61 loc) · 1.93 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: ci
on:
push:
branches: [main]
pull_request:
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
TURBO_TELEMETRY_DISABLED: '1'
jobs:
ci:
name: ci (node ${{ matrix.node }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [20, 22]
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: flakemetry
POSTGRES_PASSWORD: flakemetry
POSTGRES_DB: flakemetry
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U flakemetry -d flakemetry"
--health-interval 5s
--health-timeout 3s
--health-retries 10
env:
DATABASE_URL: postgresql://flakemetry:flakemetry@localhost:5432/flakemetry?schema=public
REQUIRE_DB: '1'
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- uses: actions/cache@v6
with:
path: node_modules/.cache/turbo
key: turbo-${{ runner.os }}-node${{ matrix.node }}-${{ github.sha }}
restore-keys: |
turbo-${{ runner.os }}-node${{ matrix.node }}-
- name: Apply migrations for test schemas
run: |
for schema in flakemetry_test_db flakemetry_test_api flakemetry_test_worker flakemetry_test_queries; do
DATABASE_URL="postgresql://flakemetry:flakemetry@localhost:5432/flakemetry?schema=$schema" \
pnpm --filter @flakemetry/db exec prisma migrate deploy
done
- run: pnpm format:check
- run: pnpm turbo run build lint typecheck test ${{ github.event_name == 'pull_request' && '--affected' || '' }}
env:
TURBO_SCM_BASE: origin/main