Repository navigation
283 lines (274 loc) · 10.9 KB
/
Copy pathci.yml
File metadata and controls
283 lines (274 loc) · 10.9 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
name: CI
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened, labeled]
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
checks:
name: Checks
if: github.event_name != 'pull_request' || github.base_ref == 'main' || contains(github.event.pull_request.labels.*.name, 'aggregate-ci')
runs-on: ubuntu-latest
env:
AGENTOS_SKIP_NATIVE_META_BUILD: '1'
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: |
rm -rf /tmp/docs-theme
git clone https://github.com/rivet-dev/docs-theme.git /tmp/docs-theme
git -C /tmp/docs-theme checkout 450c498555135098c6a927adfdf13458be9be22a
rm -rf website/vendor/theme && mkdir -p website/vendor
cp -r /tmp/docs-theme/packages/theme website/vendor/theme
- run: pnpm install --frozen-lockfile
- run: |
# Browser runtime sources remain in-tree, but are intentionally disabled
# until their sidecar/reactor architecture has a separate approved design.
# Native sidecars are built by the parallel Rust job, never by this graph.
if grep -qE '^[[:space:]]*-[[:space:]]*website[[:space:]]*$' pnpm-workspace.yaml; then
npx turbo build \
--only \
--concurrency=4 \
--filter='!@rivet-dev/agentos-runtime-browser'
else
npx turbo build \
--only \
--concurrency=4 \
--filter='!@rivet-dev/agentos-runtime-browser'
fi
- run: pnpm --dir scripts/publish run check-types
- run: pnpm --dir scripts/publish test
- run: node --test scripts/check-rust-package-metadata.test.mjs
- run: node scripts/check-rust-package-metadata.mjs
- run: node --test scripts/check-agentos-client-protocol-compat.test.mjs
- run: node scripts/check-agentos-client-protocol-compat.mjs
- run: node --test scripts/verify-fixed-versions.test.mjs
- run: node scripts/verify-fixed-versions.mjs
- run: node --test scripts/check-layout.test.mjs
- run: pnpm check-layout
- run: node --test scripts/check-rustfmt.test.mjs
- run: node scripts/check-rustfmt.mjs
- run: pnpm check-types
- name: Run fast package unit tests
run: |
pnpm --parallel --aggregate-output \
--filter '@rivet-dev/agentos-build-tools' \
--filter '@rivet-dev/agentos-toolchain' \
--filter '@rivet-dev/agentos-runtime-sidecar' \
test
- run: pnpm lint
continue-on-error: true
- name: Pack JavaScript build outputs
run: |
tar \
--exclude='software/*/dist/package' \
--exclude='software/*/dist/package.tar' \
--exclude='software/*/dist/package.aospkg' \
-czf /tmp/agentos-js-dist.tar.gz \
packages/*/dist software/*/dist test-harness/dist
- uses: actions/upload-artifact@v4
with:
name: js-dist
path: /tmp/agentos-js-dist.tar.gz
retention-days: 1
if-no-files-found: error
wasm-commands:
name: WASM Commands
if: github.event_name != 'pull_request' || github.base_ref == 'main' || contains(github.event.pull_request.labels.*.name, 'aggregate-ci')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- uses: dtolnay/rust-toolchain@nightly
with:
targets: wasm32-wasip1
- uses: Swatinem/rust-cache@v2
with:
workspaces: toolchain -> target
key: wasm-commands-${{ hashFiles('toolchain/Cargo.lock') }}
- run: pnpm install --frozen-lockfile --filter '@rivet-dev/agentos-runtime-core...'
- run: make -C toolchain pr-commands
- run: node packages/runtime-core/scripts/copy-wasm-commands.mjs --require-coreutils
- uses: actions/upload-artifact@v4
with:
name: wasm-commands
path: packages/runtime-core/commands
retention-days: 1
if-no-files-found: error
rust:
name: Rust
if: github.event_name != 'pull_request' || github.base_ref == 'main' || contains(github.event.pull_request.labels.*.name, 'aggregate-ci')
runs-on: ubuntu-latest
env:
CARGO_PROFILE_DEV_DEBUG: '0'
CARGO_PROFILE_TEST_DEBUG: '0'
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
with:
key: native-pr-${{ hashFiles('Cargo.lock') }}
- name: Install V8 bridge build dependencies
run: pnpm install --frozen-lockfile --filter '@rivet-dev/agentos-build-tools...'
- name: Verify generated VM config bindings
run: |
cargo test -p agentos-vm-config --quiet
git diff --exit-code -- packages/runtime-core/src/generated
- name: Build PR sidecar binary
run: cargo build -p agentos-native-sidecar
- run: cargo clippy --workspace --exclude agentos-native-sidecar-browser --all-targets -- -D warnings
- name: Test Rust client contracts
env:
AGENTOS_SIDECAR_BIN: ${{ github.workspace }}/target/debug/agentos-native-sidecar
run: |
cargo test -p agentos-client \
--features service-internals \
--lib \
--test scaffold \
--test e2e_smoke \
--test fs_e2e \
--test lifecycle_e2e \
--test mount_e2e \
--test sidecar_pool_e2e \
--test cron_e2e \
--test cron_grammar_e2e \
--test vm_config_compare_e2e \
-- --test-threads=1
- name: Stage stripped sidecar artifacts
run: |
mkdir -p ci-artifacts/agentos-native-sidecar
cp target/debug/agentos-native-sidecar ci-artifacts/agentos-native-sidecar/agentos-native-sidecar
strip --strip-all ci-artifacts/agentos-native-sidecar/agentos-native-sidecar
- uses: actions/upload-artifact@v4
with:
name: agentos-native-sidecar
path: ci-artifacts/agentos-native-sidecar/agentos-native-sidecar
retention-days: 1
if-no-files-found: error
core-pr:
name: Core PR
if: github.event_name != 'pull_request' || github.base_ref == 'main' || contains(github.event.pull_request.labels.*.name, 'aggregate-ci')
needs: [checks, rust, wasm-commands]
runs-on: ubuntu-latest
env:
AGENTOS_SKIP_NATIVE_META_BUILD: '1'
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- run: pnpm install --frozen-lockfile --filter '@rivet-dev/agentos-core...' --filter 'secure-exec...'
- uses: actions/download-artifact@v4
with:
name: js-dist
path: ci-artifacts/js
- uses: actions/download-artifact@v4
with:
name: agentos-native-sidecar
path: ci-artifacts/agentos-native-sidecar
- uses: actions/download-artifact@v4
with:
name: wasm-commands
path: packages/runtime-core/commands
- name: Restore runtime inputs
run: |
tar -xzf ci-artifacts/js/agentos-js-dist.tar.gz
chmod +x ci-artifacts/agentos-native-sidecar/agentos-native-sidecar
node packages/runtime-core/scripts/copy-wasm-commands.mjs --require-coreutils
pnpm --filter @agentos-software/coreutils build:runtime
- run: pnpm --dir packages/core test:pr
env:
AGENTOS_SIDECAR_BIN: ${{ github.workspace }}/ci-artifacts/agentos-native-sidecar/agentos-native-sidecar
- run: pnpm --dir secure-exec test
env:
AGENTOS_SIDECAR_BIN: ${{ github.workspace }}/ci-artifacts/agentos-native-sidecar/agentos-native-sidecar
runtime-core-pr:
name: Runtime Core PR
if: github.event_name != 'pull_request' || github.base_ref == 'main' || contains(github.event.pull_request.labels.*.name, 'aggregate-ci')
needs: [checks, rust, wasm-commands]
runs-on: ubuntu-latest
env:
AGENTOS_SKIP_NATIVE_META_BUILD: '1'
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- run: pnpm install --frozen-lockfile --filter '@rivet-dev/agentos-runtime-core...'
- uses: actions/download-artifact@v4
with:
name: js-dist
path: ci-artifacts/js
- uses: actions/download-artifact@v4
with:
name: agentos-native-sidecar
path: ci-artifacts/agentos-native-sidecar
- uses: actions/download-artifact@v4
with:
name: wasm-commands
path: packages/runtime-core/commands
- name: Restore runtime inputs
run: |
tar -xzf ci-artifacts/js/agentos-js-dist.tar.gz
chmod +x ci-artifacts/agentos-native-sidecar/agentos-native-sidecar
node packages/runtime-core/scripts/copy-wasm-commands.mjs --require-coreutils
- run: pnpm --dir packages/runtime-core test:pr
env:
AGENTOS_NATIVE_SIDECAR_BIN: ${{ github.workspace }}/ci-artifacts/agentos-native-sidecar/agentos-native-sidecar
required:
name: CI / Required
if: ${{ always() && (github.event_name != 'pull_request' || github.base_ref == 'main' || contains(github.event.pull_request.labels.*.name, 'aggregate-ci')) }}
needs: [checks, wasm-commands, rust, core-pr, runtime-core-pr]
runs-on: ubuntu-latest
steps:
- name: Require every PR gate
env:
CHECKS_RESULT: ${{ needs.checks.result }}
WASM_RESULT: ${{ needs.wasm-commands.result }}
RUST_RESULT: ${{ needs.rust.result }}
CORE_RESULT: ${{ needs.core-pr.result }}
RUNTIME_CORE_RESULT: ${{ needs.runtime-core-pr.result }}
run: |
for result in \
"$CHECKS_RESULT" \
"$WASM_RESULT" \
"$RUST_RESULT" \
"$CORE_RESULT" \
"$RUNTIME_CORE_RESULT"; do
if [ "$result" != success ]; then
echo "required CI job did not succeed: $result" >&2
exit 1
fi
done