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:
pull_request:
# jobs can be separated if we integrate tests
jobs:
build, clippy & fmt:
clippy & fmt:
runs-on: alpine
container: node:26-alpine
container: rust:alpine
env:
CARGO_HOME: ${{ github.workspace }}/.cargo
@@ -17,48 +16,26 @@ jobs:
- name: Cache cargo packages
uses: actions/cache@v4
env:
cache-name: cache-cargo-packages
with:
path: |
.cargo/registry
.cargo/git
target
key: rust-build-${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/Cargo.lock') }}
key: rust-build-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
rust-${{ runner.os }}-build-${{ env.cache-name }}-
rust-${{ runner.os }}-build-
rust-
rust-${{ runner.os }}-cargo-
- name: Install tools
run: |
apk add --no-cache \
git \
cargo \
rust \
rust-clippy \
rustfmt
apk add --no-cache git
rustup component add clippy rustfmt
- name: Cargo 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
- name: Clippy (with compile check)
run: |
if [ -n "$(find . -name "Cargo.toml" -print -quit)" ]; then
status=0
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 failed"; status=1; }
done
@@ -69,6 +46,7 @@ jobs:
else
echo "No Rust project found"
fi
- name: Format check
run: |
if [ -n "$(find . -name "Cargo.toml" -print -quit)" ]; then