Open History to see the last commit
1name: Check
2on:
3 workflow_dispatch:
4 pull_request:
5 branches: [main, v4/next-minor, v4/next-major]
6 push:
7 branches: [main, v4/next-minor, v4/next-major]
8
9concurrency:
10 group: ${{ github.workflow }}-${{ github.ref }}
11 cancel-in-progress: true
12
13permissions: {}
14
15jobs:
16 static-checks:
17 name: Static
18 runs-on: ubuntu-latest
19 permissions:
20 contents: read
21 timeout-minutes: 10
22 steps:
23 - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
24 - name: Install dependencies
25 uses: ./.github/actions/setup
26 - name: Lint
27 run: pnpm lint
28 - name: Check JSDoc
29 run: pnpm jsdocs --check
30 - name: Check circular dependencies
31 run: pnpm circular
32 - name: Generate AI documentation
33 run: pnpm ai-docgen
34 - name: Verify AI documentation is up-to-date
35 run: |
36 if [ -n "$(git status --short)" ]; then
37 git status --short
38 echo "Run 'pnpm ai-docgen' and commit generated changes."
39 exit 1
40 fi
41
42 # Each type check takes several minutes on a slow runner, so they run in
43 # parallel instead of sharing one job's timeout.
44 types-matrix:
45 name: Types (${{ matrix.name }})
46 runs-on: namespace-profile-linux-small
47 permissions:
48 contents: read
49 timeout-minutes: 10
50 strategy:
51 fail-fast: false
52 matrix:
53 include:
54 # CI type checks with the official compiler; `pnpm check` runs tsrs locally.
55 - name: Check
56 deno: ""
57 command: pnpm check-tsc
58 - name: Deno
59 deno: v2.9.6
60 command: deno check .
61 - name: Tests
62 deno: ""
63 command: pnpm test-types --target '>=5.9'
64 - name: Alchemy
65 deno: ""
66 command: pnpm exec tsc -b packages/platform/cloudflare/tsconfig.alchemy.json
67 steps:
68 - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
69 - name: Install dependencies
70 uses: ./.github/actions/setup
71 with:
72 deno-version: ${{ matrix.deno }}
73 - run: ${{ matrix.command }}
74 env:
75 # Leave memory headroom for the runner by collecting the Go heap earlier.
76 GOMEMLIMIT: 4GiB
77 TSTYCHE_FETCH_TIMEOUT: "120"
78
79 # Keeps the required `Types` status check covering every job above.
80 types:
81 name: Types
82 needs: types-matrix
83 if: always()
84 runs-on: ubuntu-latest
85 permissions: {}
86 timeout-minutes: 5
87 steps:
88 - name: Check type jobs
89 if: needs.types-matrix.result != 'success'
90 run: |
91 echo "Type checks finished with result: ${{ needs.types-matrix.result }}"
92 exit 1
93
94 build:
95 name: Build
96 if: github.event_name == 'pull_request'
97 runs-on: ubuntu-latest
98 permissions:
99 contents: read
100 timeout-minutes: 10
101 steps:
102 - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
103 - name: Install dependencies
104 uses: ./.github/actions/setup
105 - name: Set strip internals config
106 run: |
107 sed -i 's/"stripInternal": false/"stripInternal": true/' tsconfig.base.json
108 - run: pnpm build
109 - run: pnpm check-dist-types
110
111 bundle:
112 name: Bundle
113 if: github.event_name == 'pull_request'
114 runs-on: ubuntu-latest
115 permissions:
116 contents: read
117 timeout-minutes: 10
118 steps:
119 - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
120 - name: Install dependencies
121 uses: ./.github/actions/setup
122 - name: Clone base ref
123 uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
124 with:
125 path: base
126 ref: ${{ github.event.pull_request.base.ref }}
127 - name: Set strip internals config
128 run: |
129 sed -i 's/"stripInternal": false/"stripInternal": true/' tsconfig.base.json
130 sed -i 's/"stripInternal": false/"stripInternal": true/' base/tsconfig.base.json
131 - name: Build
132 run: |
133 pnpm build
134 cd base
135 pnpm install
136 pnpm build
137 - name: Compare bundle size
138 run: node ./packages/tools/bundle/src/bin.ts compare --base-dir base/packages/tools/bundle/fixtures
139 - name: Upload stats artifact
140 if: github.event_name == 'pull_request'
141 uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
142 with:
143 name: bundle-stats
144 path: stats.txt
145 if-no-files-found: error
146
147 test:
148 name: Test (${{ matrix.runtime }})
149 runs-on: namespace-profile-linux-default
150 env:
151 EFFECT_INTEGRATION_TESTS: "1"
152 # MSSQL integration tests are too flaky for CI; run them locally instead.
153 EFFECT_MSSQL_INTEGRATION_TESTS: "0"
154 # The ephemeral runner provides cleanup without a Ryuk sidecar.
155 TESTCONTAINERS_RYUK_DISABLED: "true"
156 permissions:
157 contents: read
158 timeout-minutes: 15
159 strategy:
160 fail-fast: false
161 matrix:
162 include:
163 - runtime: Node
164 node: ""
165 deno: ""
166 bun: ""
167 # The full suite exceeds Node's default ~2 GiB heap on this runner.
168 command: NODE_OPTIONS=--max-old-space-size=4096 pnpm test --max-concurrency=10
169 # Node 25 and older handle upgrade request bodies differently.
170 - runtime: Node 24 (platform-node)
171 node: 24
172 deno: ""
173 bun: ""
174 command: pnpm vitest run --project @effect/platform-node --max-concurrency=10
175 - runtime: Deno
176 deno: v2.9.6
177 bun: ""
178 command: deno task test --max-concurrency=10
179 - runtime: Bun
180 deno: ""
181 bun: 1.4.0
182 command: bun run --bun vitest run --max-concurrency=10
183 steps:
184 - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
185
186 - name: Pre-pull test container images
187 run: |
188 docker pull ghcr.io/tursodatabase/libsql-server:main &
189 docker pull postgres:14-alpine &
190 docker pull mysql:lts &
191 docker pull vitess/vttestserver:mysql80 &
192 docker pull redis:alpine &
193 docker pull coredns/coredns:1.14.7 &
194 wait
195
196 - name: Install dependencies
197 uses: ./.github/actions/setup
198 with:
199 node-version: ${{ matrix.node }}
200 deno-version: ${{ matrix.deno }}
201 bun-version: ${{ matrix.bun }}
202 - name: Test
203 if: matrix.runtime != 'Deno'
204 run: ${{ matrix.command }}
205 - name: Test with PostgreSQL lifecycle capture
206 if: matrix.runtime == 'Deno'
207 shell: bash
208 env:
209 PG_LIFECYCLE_DIAGNOSTICS: "1"
210 PG_LIFECYCLE_LOG: ${{ runner.temp }}/pg-lifecycle/lifecycle.log
211 run: |
212 capture_dir="${{ runner.temp }}/pg-lifecycle"
213 mkdir -p "$capture_dir"
214 started_at=$(date --iso-8601=seconds)
215 docker events --since "$started_at" --format '{{json .}}' > "$capture_dir/docker-events.jsonl" 2> "$capture_dir/docker-events.stderr" &
216 events_pid=$!
217 cleanup() {
218 # Reap only the capture process started here; preserve the test exit code.
219 kill "$events_pid" 2>/dev/null || true
220 wait "$events_pid" 2>/dev/null || true
221 # The runner owns the output file; only journal access needs sudo.
222 # shellcheck disable=SC2024
223 sudo -n journalctl -u docker.service --since "$started_at" --no-pager -o short-iso-precise > "$capture_dir/docker-journal.log" 2>&1 || true
224 }
225 trap cleanup EXIT
226 trap 'exit 130' INT
227 trap 'exit 143' TERM
228 ${{ matrix.command }} 2>&1 | tee "$capture_dir/tests.log"
229 - name: Upload PostgreSQL lifecycle diagnostics
230 if: always() && matrix.runtime == 'Deno' && (failure() || cancelled())
231 uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
232 with:
233 name: deno-pg-lifecycle-${{ github.run_attempt }}
234 path: ${{ runner.temp }}/pg-lifecycle
235 if-no-files-found: warn
236
237 test-node-minimum:
238 name: Test (Node 22.19.0 minimum)
239 runs-on: namespace-profile-linux-default
240 permissions:
241 contents: read
242 timeout-minutes: 15
243 steps:
244 - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
245 - name: Install dependencies
246 uses: ./.github/actions/setup
247 with:
248 node-version: 22.19.0
249 - name: Test
250 run: pnpm vitest run --project @effect/platform-node --max-concurrency=10
251
252 doctest:
253 name: Test (Documentation)
254 runs-on: namespace-profile-linux-small
255 permissions:
256 contents: read
257 timeout-minutes: 10
258 steps:
259 - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
260 - name: Install dependencies
261 uses: ./.github/actions/setup
262 - name: Test Documentation
263 run: pnpm doctest