Repository navigation
116 lines (93 loc) · 3.48 KB
/
Copy pathci.yml
File metadata and controls
116 lines (93 loc) · 3.48 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: CI — Test & Coverage
on:
push:
branches: [master]
pull_request:
branches: [master]
# A newer push to a pull request cancels its older run; on master the running
# run finishes and only the newest pending run is kept.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
test:
name: Unit Tests + Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 22
- name: Install SDK dependencies
run: cd sdk && npm install
- name: Run SDK tests
run: cd sdk && npx vitest run --config vitest.config.ts
env:
CI: true
typecheck:
name: Type Check (SDK)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 22
- name: Install SDK dependencies
run: cd sdk && npm install
- name: Type check SDK
run: cd sdk && npx tsc --noEmit
typecheck-workspace:
name: Type Check (Backend + Social)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v4
with:
version: 10.15.1
- uses: actions/setup-node@v5
with:
node-version: 22
cache: pnpm
- name: Install backend and its workspace dependencies
run: pnpm install --frozen-lockfile --ignore-scripts --filter "@wunderland-sol/backend..."
- name: Type check packages/wunderland-social
run: pnpm --filter @wunderland/social exec tsc --noEmit -p tsconfig.json
# The backend reads both packages through their built declarations.
# tsc still emits when it reports errors, so after a failed check above
# this step writes the declarations, fails on its own, and the backend
# check below runs and reports too. Errors only declaration emit can
# find (an inferred type it cannot name) surface here, not above.
- name: Build workspace declarations
if: ${{ !cancelled() }}
run: |
pnpm --filter @wunderland-sol/sdk exec tsc -p tsconfig.json
pnpm --filter @wunderland/social exec tsc -p tsconfig.json
- name: Type check backend
if: ${{ !cancelled() }}
run: pnpm --filter @wunderland-sol/backend exec tsc --noEmit -p tsconfig.build.json
backend-tests:
name: Backend Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v4
with:
version: 10.15.1
- uses: actions/setup-node@v5
with:
node-version: 22
cache: pnpm
# Install scripts stay on here: pnpm-workspace.yaml allows only
# better-sqlite3 to build, and the database-backed suites open an
# in-memory better-sqlite3 database through the storage adapter.
- name: Install backend and its workspace dependencies
run: pnpm install --frozen-lockfile --filter "@wunderland-sol/backend..."
# The backend imports both workspace packages through their dist output.
- name: Build workspace packages
run: |
pnpm --filter @wunderland-sol/sdk exec tsc -p tsconfig.json
pnpm --filter @wunderland/social exec tsc -p tsconfig.json
- name: Run backend test suite
run: pnpm --filter @wunderland-sol/backend exec vitest run
env:
CI: true