-
Notifications
You must be signed in to change notification settings - Fork 2
224 lines (205 loc) · 11.6 KB
/
rust.yml
File metadata and controls
224 lines (205 loc) · 11.6 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
name: Rust
on:
push:
branches: [main]
tags:
- "*"
pull_request:
branches: [main]
workflow_dispatch:
jobs:
ci:
name: ${{ matrix.label }}
strategy:
fail-fast: false
matrix:
include:
- { label: "Async Linux", os: ubuntu-latest, target: x86_64-unknown-linux-gnu, mode: async, linux_bwrap: true }
- { label: "Async Windows", os: windows-latest, target: x86_64-pc-windows-msvc, mode: async, linux_bwrap: false }
- { label: "Async macOS", os: macos-latest, target: aarch64-apple-darwin, mode: async, linux_bwrap: false }
- { label: "Blocking Linux", os: ubuntu-latest, target: x86_64-unknown-linux-gnu, mode: blocking, linux_bwrap: true }
- { label: "Blocking Windows", os: windows-latest, target: x86_64-pc-windows-msvc, mode: blocking, linux_bwrap: false }
- { label: "Blocking macOS", os: macos-latest, target: aarch64-apple-darwin, mode: blocking, linux_bwrap: false }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: Run tests (Async) and upload coverage
if: matrix.mode == 'async'
uses: Reloaded-Project/devops-rust-test-and-coverage@v1
with:
rust-project-path: ./src
upload-coverage: true
codecov-token: ${{ secrets.CODECOV_TOKEN }}
codecov-flags: async
codecov-name: ${{ matrix.label }}
target: ${{ matrix.target }}
packages: |
reloaded-code-core
reloaded-code-agents
reloaded-code-serdesai
reloaded-code-models-dev
- name: Run tests (Blocking) and upload coverage
if: matrix.mode == 'blocking'
uses: Reloaded-Project/devops-rust-test-and-coverage@v1
with:
rust-project-path: ./src
upload-coverage: true
codecov-token: ${{ secrets.CODECOV_TOKEN }}
codecov-flags: blocking
codecov-name: ${{ matrix.label }}
target: ${{ matrix.target }}
packages: |
reloaded-code-core
reloaded-code-models-dev
no-default-features: true
features: "blocking"
- name: Run Linux-only async feature coverage
if: matrix.mode == 'async' && matrix.linux_bwrap
working-directory: src
shell: bash
run: |
cargo test -p reloaded-code-bubblewrap
cargo test -p reloaded-code-core --features linux-bubblewrap
cargo test -p reloaded-code-serdesai --features linux-bubblewrap
- name: Run Linux-only blocking feature coverage
if: matrix.mode == 'blocking' && matrix.linux_bwrap
working-directory: src
shell: bash
run: |
cargo test -p reloaded-code-bubblewrap --no-default-features --features blocking
cargo test -p reloaded-code-core --no-default-features --features blocking,linux-bubblewrap
- name: Check documentation is valid
working-directory: src
shell: bash
env:
RUSTDOCFLAGS: "-D warnings"
run: |
case "${{ matrix.mode }}:${{ matrix.linux_bwrap }}" in
async:true)
cargo doc -p reloaded-code-bubblewrap --document-private-items --no-deps --target ${{ matrix.target }}
cargo doc -p reloaded-code-core --features linux-bubblewrap --document-private-items --no-deps --target ${{ matrix.target }}
cargo doc -p reloaded-code-agents --document-private-items --no-deps --target ${{ matrix.target }}
cargo doc -p reloaded-code-serdesai --features linux-bubblewrap --document-private-items --no-deps --target ${{ matrix.target }}
cargo doc -p reloaded-code-models-dev --document-private-items --no-deps --target ${{ matrix.target }}
;;
async:false)
cargo doc -p reloaded-code-core --document-private-items --no-deps --target ${{ matrix.target }}
cargo doc -p reloaded-code-agents --document-private-items --no-deps --target ${{ matrix.target }}
cargo doc -p reloaded-code-serdesai --document-private-items --no-deps --target ${{ matrix.target }}
cargo doc -p reloaded-code-models-dev --document-private-items --no-deps --target ${{ matrix.target }}
;;
blocking:true)
cargo doc -p reloaded-code-bubblewrap --no-default-features --features blocking --document-private-items --no-deps --target ${{ matrix.target }}
cargo doc -p reloaded-code-core --no-default-features --features blocking,linux-bubblewrap --document-private-items --no-deps --target ${{ matrix.target }}
cargo doc -p reloaded-code-models-dev --no-default-features --features blocking --document-private-items --no-deps --target ${{ matrix.target }}
;;
blocking:false)
cargo doc -p reloaded-code-core --no-default-features --features blocking --document-private-items --no-deps --target ${{ matrix.target }}
cargo doc -p reloaded-code-models-dev --no-default-features --features blocking --document-private-items --no-deps --target ${{ matrix.target }}
;;
esac
- name: Run linter
working-directory: src
shell: bash
run: |
case "${{ matrix.mode }}:${{ matrix.linux_bwrap }}" in
async:true)
cargo clippy -p reloaded-code-bubblewrap --target ${{ matrix.target }} -- -D warnings
cargo clippy -p reloaded-code-core --features linux-bubblewrap --target ${{ matrix.target }} -- -D warnings
cargo clippy -p reloaded-code-agents --target ${{ matrix.target }} -- -D warnings
cargo clippy -p reloaded-code-serdesai --features linux-bubblewrap --target ${{ matrix.target }} -- -D warnings
cargo clippy -p reloaded-code-models-dev --target ${{ matrix.target }} -- -D warnings
;;
async:false)
cargo clippy -p reloaded-code-core --target ${{ matrix.target }} -- -D warnings
cargo clippy -p reloaded-code-agents --target ${{ matrix.target }} -- -D warnings
cargo clippy -p reloaded-code-serdesai --target ${{ matrix.target }} -- -D warnings
cargo clippy -p reloaded-code-models-dev --target ${{ matrix.target }} -- -D warnings
;;
blocking:true)
cargo clippy -p reloaded-code-bubblewrap --no-default-features --features blocking --target ${{ matrix.target }} -- -D warnings
cargo clippy -p reloaded-code-core --no-default-features --features blocking,linux-bubblewrap --target ${{ matrix.target }} -- -D warnings
cargo clippy -p reloaded-code-models-dev --no-default-features --features blocking --target ${{ matrix.target }} -- -D warnings
;;
blocking:false)
cargo clippy -p reloaded-code-core --no-default-features --features blocking --target ${{ matrix.target }} -- -D warnings
cargo clippy -p reloaded-code-models-dev --no-default-features --features blocking --target ${{ matrix.target }} -- -D warnings
;;
esac
format:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Run formatter check
if: github.event_name == 'pull_request' || startsWith(github.ref, 'refs/tags/')
uses: actions-rust-lang/rustfmt@v1
with:
manifest-path: src/Cargo.toml
semver-checks:
name: Semver Checks (${{ matrix.label }})
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' || startsWith(github.ref, 'refs/tags/')
strategy:
fail-fast: false
# Each matrix row represents one semver surface (package + feature combo).
#
# Linux-only coverage is sufficient because:
# - `linux-bubblewrap` exports extra public items only on Linux
# - Windows/macOS cfg branches are implementation-only today
# - `maybe-async` changes public signatures, so async and blocking must both be checked
#
# Cache strategy:
# - `prefix-key` is unique per row because upstream rustdoc cache excludes feature flags
# - `shared-key` is intentionally unset — upstream warns against reuse across surfaces
# - Wrapper handles checkout, toolchain, and normal Cargo cache automatically
matrix:
include:
- { label: "Core Async", package: reloaded-code-core, feature_group: only-explicit-features, features: tokio, prefix_key: core-async-tokio }
- { label: "Core Async+Linux", package: reloaded-code-core, feature_group: only-explicit-features, features: "tokio,linux-bubblewrap", prefix_key: core-async-tokio-linux-bwrap }
- { label: "Serdesai Full", package: reloaded-code-serdesai, feature_group: only-explicit-features, features: full, prefix_key: serdesai-async-full }
- { label: "Serdesai Full+Linux", package: reloaded-code-serdesai, feature_group: only-explicit-features, features: "full,linux-bubblewrap", prefix_key: serdesai-async-full-linux-bwrap }
- { label: "Agents+Models", package: "reloaded-code-agents,reloaded-code-models-dev", feature_group: default-features, features: "", prefix_key: agents-models-dev-default }
- { label: "Bubblewrap Base", package: reloaded-code-bubblewrap, feature_group: only-explicit-features, features: "", prefix_key: bubblewrap-base }
- { label: "Bubblewrap Async", package: reloaded-code-bubblewrap, feature_group: only-explicit-features, features: tokio, prefix_key: bubblewrap-tokio }
- { label: "Bubblewrap Blocking", package: reloaded-code-bubblewrap, feature_group: only-explicit-features, features: blocking, prefix_key: bubblewrap-blocking }
- { label: "Core Blocking", package: reloaded-code-core, feature_group: only-explicit-features, features: blocking, prefix_key: core-blocking }
- { label: "Core Blocking+Linux", package: reloaded-code-core, feature_group: only-explicit-features, features: "blocking,linux-bubblewrap", prefix_key: core-blocking-linux-bwrap }
- { label: "Models Blocking", package: reloaded-code-models-dev, feature_group: only-explicit-features, features: blocking, prefix_key: models-dev-blocking }
steps:
- name: Run semver check surface
uses: Reloaded-Project/devops-cargo-semver-checks-action@v1
with:
manifest-path: src/Cargo.toml
package: ${{ matrix.package }}
feature-group: ${{ matrix.feature_group }}
features: ${{ matrix.features }}
rust-toolchain: stable
rust-target: x86_64-unknown-linux-gnu
prefix-key: ${{ matrix.prefix_key }}
rust-cache-key-suffix: ${{ matrix.prefix_key }}
publish-crate:
permissions:
contents: write
needs: [ci, format, semver-checks]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Publish Rust Crate and Artifacts
uses: Reloaded-Project/devops-publish-action@v3
with:
rust-crates-io-token: ${{ secrets.CRATES_IO_TOKEN }}
rust-cargo-project-paths: |
src/reloaded-code-bubblewrap
src/reloaded-code-core
src/reloaded-code-agents
src/reloaded-code-serdesai
src/reloaded-code-models-dev
compression-tool: 7z
artifact-groups-file: .github/artifact-groups.yml
changelog-enabled: "true"
changelog-template: .github/changelog.hbs
changelog-is-release: ${{ startsWith(github.ref, 'refs/tags/') }}
changelog-release-tag: ${{ github.ref_name }}
changelog-override-starting-version: "true"
changelog-hide-credit: "true"