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 circular dependencies
29 run: pnpm circular
30 - name: Generate AI documentation
31 run: pnpm ai-docgen
32 - name: Verify AI documentation is up-to-date
33 run: |
34 if [ -n "$(git status --short)" ]; then
35 git status --short
36 echo "Run 'pnpm ai-docgen' and commit generated changes."
37 exit 1
38 fi
39
40 types:
41 name: Types
42 runs-on: namespace-profile-linux-small
43 permissions:
44 contents: read
45 timeout-minutes: 10
46 steps:
47 - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
48 - name: Install dependencies
49 uses: ./.github/actions/setup
50 with:
51 deno-version: v2.9.4
52 - run: pnpm check
53 env:
54 # Leave memory headroom for the runner by collecting the Go heap earlier.
55 GOMEMLIMIT: 4GiB
56 - run: deno check .
57 - run: pnpm test-types --target '>=5.9'
58
59 build:
60 name: Build
61 if: github.event_name == 'pull_request'
62 runs-on: ubuntu-latest
63 permissions:
64 contents: read
65 timeout-minutes: 10
66 steps:
67 - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
68 - name: Install dependencies
69 uses: ./.github/actions/setup
70 - name: Set strip internals config
71 run: |
72 sed -i 's/"stripInternal": false/"stripInternal": true/' tsconfig.base.json
73 - run: pnpm build
74 - run: pnpm check-dist-types
75
76 bundle:
77 name: Bundle
78 if: github.event_name == 'pull_request'
79 runs-on: ubuntu-latest
80 permissions:
81 contents: read
82 timeout-minutes: 10
83 steps:
84 - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
85 - name: Install dependencies
86 uses: ./.github/actions/setup
87 - name: Clone base ref
88 uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
89 with:
90 path: base
91 ref: ${{ github.event.pull_request.base.ref }}
92 - name: Set strip internals config
93 run: |
94 sed -i 's/"stripInternal": false/"stripInternal": true/' tsconfig.base.json
95 sed -i 's/"stripInternal": false/"stripInternal": true/' base/tsconfig.base.json
96 - name: Build
97 run: |
98 pnpm build
99 cd base
100 pnpm install
101 pnpm build
102 - name: Compare bundle size
103 run: node ./packages/tools/bundle/src/bin.ts compare --base-dir base/packages/tools/bundle/fixtures
104 - name: Upload stats artifact
105 if: github.event_name == 'pull_request'
106 uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
107 with:
108 name: bundle-stats
109 path: stats.txt
110 if-no-files-found: error
111
112 test:
113 name: Test (${{ matrix.runtime }})
114 runs-on: namespace-profile-linux-default
115 env:
116 EFFECT_INTEGRATION_TESTS: "1"
117 # The ephemeral runner provides cleanup without a Ryuk sidecar.
118 TESTCONTAINERS_RYUK_DISABLED: "true"
119 permissions:
120 contents: read
121 timeout-minutes: 15
122 strategy:
123 fail-fast: false
124 matrix:
125 include:
126 - runtime: Node
127 deno: ""
128 bun: ""
129 command: pnpm test --max-concurrency=10
130 - runtime: Deno
131 deno: v2.9.4
132 bun: ""
133 command: deno task test --max-concurrency=10
134 - runtime: Bun
135 deno: ""
136 bun: 1.4.0
137 command: bun run --bun vitest run --max-concurrency=10
138 steps:
139 - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
140
141 - name: Pre-pull test container images
142 run: |
143 docker pull ghcr.io/tursodatabase/libsql-server:main &
144 docker pull postgres:alpine &
145 docker pull mysql:lts &
146 docker pull mcr.microsoft.com/mssql/server:2022-latest &
147 docker pull vitess/vttestserver:mysql80 &
148 docker pull redis:alpine &
149 wait
150
151 - name: Install dependencies
152 uses: ./.github/actions/setup
153 with:
154 deno-version: ${{ matrix.deno }}
155 bun-version: ${{ matrix.bun }}
156 - name: Test
157 run: ${{ matrix.command }}
158
159 doctest:
160 name: Test (Documentation)
161 runs-on: namespace-profile-linux-small
162 permissions:
163 contents: read
164 timeout-minutes: 10
165 steps:
166 - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
167 - name: Install dependencies
168 uses: ./.github/actions/setup
169 - name: Test Documentation
170 run: pnpm doctest