ci(rust): fixes and optimizations
C++ / fmt (pull_request) Failing after 5s
C++ / build & lint (pull_request) Failing after 13s
JS/TS / fmt & lint (pull_request) Successful in 11s
Python / fmt & lint (pull_request) Successful in 26s
Rust / clippy & fmt (pull_request) Failing after 50s
Python / test & nuitka build (pull_request) Failing after 1m23s

- removes cargo check since the clippy step builds already
- image switched to rust:alpine
- less correctness during build for speedier compilation
This commit is contained in:
2026-10-30 02:49:22 +01:00
parent ab4a662013
commit 388482c620
+9 -31
View File
@@ -3,11 +3,10 @@ name: Rust
on: on:
pull_request: pull_request:
# jobs can be separated if we integrate tests
jobs: jobs:
build, clippy & fmt: clippy & fmt:
runs-on: alpine runs-on: alpine
container: node:26-alpine container: rust:alpine
env: env:
CARGO_HOME: ${{ github.workspace }}/.cargo CARGO_HOME: ${{ github.workspace }}/.cargo
@@ -17,48 +16,26 @@ jobs:
- name: Cache cargo packages - name: Cache cargo packages
uses: actions/cache@v4 uses: actions/cache@v4
env:
cache-name: cache-cargo-packages
with: with:
path: | path: |
.cargo/registry .cargo/registry
.cargo/git .cargo/git
target target
key: rust-build-${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/Cargo.lock') }} key: rust-build-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: | restore-keys: |
rust-${{ runner.os }}-build-${{ env.cache-name }}- rust-${{ runner.os }}-cargo-
rust-${{ runner.os }}-build-
rust-
- name: Install tools - name: Install tools
run: | run: |
apk add --no-cache \ apk add --no-cache git
git \ rustup component add clippy rustfmt
cargo \
rust \
rust-clippy \
rustfmt
- name: Cargo check - name: Clippy (with compile check)
run: |
if [ -n "$(find . -name "Cargo.toml" -print -quit)" ]; then
for manifest in $(find . -name "Cargo.toml"); do
cargo check --manifest-path "$manifest" && \
echo "$manifest: check passed" || \
{ echo "$manifest: check failed"; exit 1; }
done
elif [ -n "$(find . -name "*.rs" -print -quit)" ]; then
echo "Rust files found but no Cargo.toml"
exit 1
else
echo "No Rust project found"
fi
- name: Clippy
run: | run: |
if [ -n "$(find . -name "Cargo.toml" -print -quit)" ]; then if [ -n "$(find . -name "Cargo.toml" -print -quit)" ]; then
status=0 status=0
for manifest in $(find . -name "Cargo.toml"); do for manifest in $(find . -name "Cargo.toml"); do
cargo clippy --manifest-path "$manifest" --all-targets --all-features -- -D warnings && \ cargo clippy --manifest-path "$manifest" -- -D warnings && \
echo "$manifest: Clippy passed" || \ echo "$manifest: Clippy passed" || \
{ echo "$manifest: Clippy failed"; status=1; } { echo "$manifest: Clippy failed"; status=1; }
done done
@@ -69,6 +46,7 @@ jobs:
else else
echo "No Rust project found" echo "No Rust project found"
fi fi
- name: Format check - name: Format check
run: | run: |
if [ -n "$(find . -name "Cargo.toml" -print -quit)" ]; then if [ -n "$(find . -name "Cargo.toml" -print -quit)" ]; then