Skip to content

Commit 4d30cd2

Browse files
authored
Merge pull request #85 from Sewer56/refactor/semver-checks-matrix
Changed: Move semver checks to matrix-based job
2 parents da13169 + 6977f2a commit 4d30cd2

1 file changed

Lines changed: 47 additions & 62 deletions

File tree

.github/workflows/rust.yml

Lines changed: 47 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -77,67 +77,6 @@ jobs:
7777
cargo test -p llm-coding-tools-bubblewrap --no-default-features --features blocking
7878
cargo test -p llm-coding-tools-core --no-default-features --features blocking,linux-bubblewrap
7979
80-
- name: Run cargo-semver-checks
81-
# Run semver checks only on Linux rows.
82-
# Linux is the only target with additional exported APIs in this workspace
83-
# (`linux-bubblewrap` and the bubblewrap crate itself); current Windows/macOS
84-
# `cfg(...)` usage is implementation-only. Blocking mode still changes public
85-
# signatures via maybe-async, so the Blocking Linux row checks that surface too.
86-
if: (github.event_name == 'pull_request' || startsWith(github.ref, 'refs/tags/')) && matrix.linux_bwrap
87-
working-directory: src
88-
shell: bash
89-
run: |
90-
cargo +stable binstall --no-confirm cargo-semver-checks --force
91-
rustup +stable target add ${{ matrix.target }}
92-
93-
case "${{ matrix.mode }}" in
94-
async)
95-
for CRATE in "llm-coding-tools-core" "llm-coding-tools-agents" "llm-coding-tools-serdesai" "llm-coding-tools-models-dev"; do
96-
SEARCH_RESULT=$(cargo search "^${CRATE}$" --limit 1)
97-
if echo "$SEARCH_RESULT" | grep -q "^${CRATE} "; then
98-
echo "Running semver checks for ${CRATE}..."
99-
if [ "${CRATE}" = "llm-coding-tools-core" ]; then
100-
cargo +stable semver-checks -p "${CRATE}" --target ${{ matrix.target }} --only-explicit-features --features tokio
101-
cargo +stable semver-checks -p "${CRATE}" --target ${{ matrix.target }} --only-explicit-features --features tokio,linux-bubblewrap
102-
elif [ "${CRATE}" = "llm-coding-tools-serdesai" ]; then
103-
cargo +stable semver-checks -p "${CRATE}" --target ${{ matrix.target }} --only-explicit-features --features full
104-
cargo +stable semver-checks -p "${CRATE}" --target ${{ matrix.target }} --only-explicit-features --features full,linux-bubblewrap
105-
else
106-
cargo +stable semver-checks -p "${CRATE}" --target ${{ matrix.target }}
107-
fi
108-
else
109-
echo "No previous version of ${CRATE} found on crates.io. Skipping semver checks."
110-
fi
111-
done
112-
113-
SEARCH_RESULT=$(cargo search "^llm-coding-tools-bubblewrap$" --limit 1)
114-
if echo "$SEARCH_RESULT" | grep -q "^llm-coding-tools-bubblewrap "; then
115-
echo "Running semver checks for llm-coding-tools-bubblewrap..."
116-
cargo +stable semver-checks -p llm-coding-tools-bubblewrap --target ${{ matrix.target }} --only-explicit-features
117-
cargo +stable semver-checks -p llm-coding-tools-bubblewrap --target ${{ matrix.target }} --only-explicit-features --features tokio
118-
cargo +stable semver-checks -p llm-coding-tools-bubblewrap --target ${{ matrix.target }} --only-explicit-features --features blocking
119-
else
120-
echo "No previous version of llm-coding-tools-bubblewrap found on crates.io. Skipping semver checks."
121-
fi
122-
;;
123-
blocking)
124-
for CRATE in "llm-coding-tools-core" "llm-coding-tools-models-dev"; do
125-
SEARCH_RESULT=$(cargo search "^${CRATE}$" --limit 1)
126-
if echo "$SEARCH_RESULT" | grep -q "^${CRATE} "; then
127-
echo "Running semver checks for ${CRATE}..."
128-
if [ "${CRATE}" = "llm-coding-tools-core" ]; then
129-
cargo +stable semver-checks -p "${CRATE}" --target ${{ matrix.target }} --only-explicit-features --features blocking
130-
cargo +stable semver-checks -p "${CRATE}" --target ${{ matrix.target }} --only-explicit-features --features blocking,linux-bubblewrap
131-
else
132-
cargo +stable semver-checks -p "${CRATE}" --target ${{ matrix.target }} --only-explicit-features --features blocking
133-
fi
134-
else
135-
echo "No previous version of ${CRATE} found on crates.io. Skipping semver checks."
136-
fi
137-
done
138-
;;
139-
esac
140-
14180
- name: Check documentation is valid
14281
if: github.event_name == 'pull_request' || startsWith(github.ref, 'refs/tags/')
14382
working-directory: src
@@ -213,11 +152,57 @@ jobs:
213152
with:
214153
manifest-path: src/Cargo.toml
215154

155+
semver-checks:
156+
name: Semver Checks (${{ matrix.label }})
157+
runs-on: ubuntu-latest
158+
if: github.event_name == 'pull_request' || startsWith(github.ref, 'refs/tags/')
159+
strategy:
160+
fail-fast: false
161+
162+
# Each matrix row represents one semver surface (package + feature combo).
163+
#
164+
# Linux-only coverage is sufficient because:
165+
# - `linux-bubblewrap` exports extra public items only on Linux
166+
# - Windows/macOS cfg branches are implementation-only today
167+
# - `maybe-async` changes public signatures, so async and blocking must both be checked
168+
#
169+
# Cache strategy:
170+
# - `prefix-key` is unique per row because upstream rustdoc cache excludes feature flags
171+
# - `shared-key` is intentionally unset — upstream warns against reuse across surfaces
172+
# - Wrapper handles checkout, toolchain, and normal Cargo cache automatically
173+
174+
matrix:
175+
include:
176+
- { label: "Core Async", package: llm-coding-tools-core, feature_group: only-explicit-features, features: tokio, prefix_key: core-async-tokio }
177+
- { label: "Core Async+Linux", package: llm-coding-tools-core, feature_group: only-explicit-features, features: "tokio,linux-bubblewrap", prefix_key: core-async-tokio-linux-bwrap }
178+
- { label: "Serdesai Full", package: llm-coding-tools-serdesai, feature_group: only-explicit-features, features: full, prefix_key: serdesai-async-full }
179+
- { label: "Serdesai Full+Linux", package: llm-coding-tools-serdesai, feature_group: only-explicit-features, features: "full,linux-bubblewrap", prefix_key: serdesai-async-full-linux-bwrap }
180+
- { label: "Agents+Models", package: "llm-coding-tools-agents,llm-coding-tools-models-dev", feature_group: default-features, features: "", prefix_key: agents-models-dev-default }
181+
- { label: "Bubblewrap Base", package: llm-coding-tools-bubblewrap, feature_group: only-explicit-features, features: "", prefix_key: bubblewrap-base }
182+
- { label: "Bubblewrap Async", package: llm-coding-tools-bubblewrap, feature_group: only-explicit-features, features: tokio, prefix_key: bubblewrap-tokio }
183+
- { label: "Bubblewrap Blocking", package: llm-coding-tools-bubblewrap, feature_group: only-explicit-features, features: blocking, prefix_key: bubblewrap-blocking }
184+
- { label: "Core Blocking", package: llm-coding-tools-core, feature_group: only-explicit-features, features: blocking, prefix_key: core-blocking }
185+
- { label: "Core Blocking+Linux", package: llm-coding-tools-core, feature_group: only-explicit-features, features: "blocking,linux-bubblewrap", prefix_key: core-blocking-linux-bwrap }
186+
- { label: "Models Blocking", package: llm-coding-tools-models-dev, feature_group: only-explicit-features, features: blocking, prefix_key: models-dev-blocking }
187+
188+
steps:
189+
- name: Run semver check surface
190+
uses: Reloaded-Project/devops-cargo-semver-checks-action@v1
191+
with:
192+
manifest-path: src/Cargo.toml
193+
package: ${{ matrix.package }}
194+
feature-group: ${{ matrix.feature_group }}
195+
features: ${{ matrix.features }}
196+
rust-toolchain: stable
197+
rust-target: x86_64-unknown-linux-gnu
198+
prefix-key: ${{ matrix.prefix_key }}
199+
rust-cache-key-suffix: ${{ matrix.prefix_key }}
200+
216201
publish-crate:
217202
permissions:
218203
contents: write
219204

220-
needs: [ci, format]
205+
needs: [ci, format, semver-checks]
221206
if: startsWith(github.ref, 'refs/tags/')
222207
runs-on: ubuntu-latest
223208
steps:

0 commit comments

Comments
 (0)