Skip to content

deps: bump the rust-dependencies group across 1 directory with 13 updates #54

deps: bump the rust-dependencies group across 1 directory with 13 updates

deps: bump the rust-dependencies group across 1 directory with 13 updates #54

Workflow file for this run

name: CI
on:
push:
branches: [master, main, develop]
pull_request:
branches: [master, main, develop]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
# =============================================================================
# Quick checks (run first, fail fast)
# =============================================================================
fmt:
name: Rustfmt
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --all-features --workspace --lib -- -D warnings
security:
name: Security Audit
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install cargo-audit
run: cargo install cargo-audit --locked
- run: cargo audit
# =============================================================================
# Tests (split by crate group to avoid disk space issues)
# =============================================================================
test-core:
name: Test Core
runs-on: ubuntu-latest
timeout-minutes: 30
needs: [fmt, clippy]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: test-core
- name: Test core crates
run: |
cargo test -p hedl-core --all-features
cargo test -p hedl-c14n --all-features
cargo test -p hedl-test --all-features
cargo test -p hedl --all-features
test-formats:
name: Test Formats
runs-on: ubuntu-latest
timeout-minutes: 30
needs: [fmt, clippy]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: test-formats
- name: Test format crates
run: |
cargo test -p hedl-json --all-features
cargo test -p hedl-yaml --all-features
cargo test -p hedl-xml --all-features
cargo test -p hedl-csv --all-features
test-data:
name: Test Data
runs-on: ubuntu-latest
timeout-minutes: 30
needs: [fmt, clippy]
services:
neo4j:
image: neo4j:5.15
env:
NEO4J_AUTH: neo4j/testpassword
ports:
- 7687:7687
- 7474:7474
options: >-
--health-cmd "cypher-shell -u neo4j -p testpassword 'RETURN 1'"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: test-data
- name: Test data crates
run: |
cargo test -p hedl-parquet --all-features
cargo test -p hedl-neo4j --all-features
cargo test -p hedl-stream --all-features
env:
NEO4J_PASSWORD: testpassword
test-tooling:
name: Test Tooling
runs-on: ubuntu-latest
timeout-minutes: 30
needs: [fmt, clippy]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: test-tooling
- name: Test tooling crates
run: |
cargo test -p hedl-lint --all-features
cargo test -p hedl-lsp --all-features
cargo test -p hedl-cli --all-features
cargo test -p hedl-mcp --all-features
test-bindings:
name: Test Bindings
runs-on: ubuntu-latest
timeout-minutes: 30
needs: [fmt, clippy]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: test-bindings
- name: Test binding crates
run: |
cargo test -p hedl-ffi --all-features
cargo test -p hedl-wasm --all-features
cargo test -p hedl-toon --all-features
# =============================================================================
# Coverage (split to avoid disk space issues, combined at end)
# =============================================================================
coverage-core:
name: Coverage Core
runs-on: ubuntu-latest
timeout-minutes: 30
continue-on-error: true
needs: [test-core]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: coverage-core
- run: cargo install cargo-llvm-cov --locked
- name: Generate coverage
run: |
cargo llvm-cov --all-features \
-p hedl-core -p hedl-c14n -p hedl-test -p hedl \
--lcov --output-path lcov-core.info
- uses: actions/upload-artifact@v4
with:
name: coverage-core
path: lcov-core.info
coverage-formats:
name: Coverage Formats
runs-on: ubuntu-latest
timeout-minutes: 30
continue-on-error: true
needs: [test-formats]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: coverage-formats
- run: cargo install cargo-llvm-cov --locked
- name: Generate coverage
run: |
cargo llvm-cov --all-features \
-p hedl-json -p hedl-yaml -p hedl-xml -p hedl-csv \
--lcov --output-path lcov-formats.info
- uses: actions/upload-artifact@v4
with:
name: coverage-formats
path: lcov-formats.info
coverage-data:
name: Coverage Data
runs-on: ubuntu-latest
timeout-minutes: 30
continue-on-error: true
needs: [test-data]
services:
neo4j:
image: neo4j:5.15
env:
NEO4J_AUTH: neo4j/testpassword
ports:
- 7687:7687
- 7474:7474
options: >-
--health-cmd "cypher-shell -u neo4j -p testpassword 'RETURN 1'"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: coverage-data
- run: cargo install cargo-llvm-cov --locked
- name: Generate coverage
run: |
cargo llvm-cov --all-features \
-p hedl-parquet -p hedl-neo4j -p hedl-stream \
--lcov --output-path lcov-data.info
env:
NEO4J_PASSWORD: testpassword
- uses: actions/upload-artifact@v4
with:
name: coverage-data
path: lcov-data.info
coverage-tooling:
name: Coverage Tooling
runs-on: ubuntu-latest
timeout-minutes: 30
continue-on-error: true
needs: [test-tooling]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: coverage-tooling
- run: cargo install cargo-llvm-cov --locked
- name: Generate coverage
run: |
cargo llvm-cov --all-features \
-p hedl-lint -p hedl-lsp -p hedl-cli -p hedl-mcp \
--lcov --output-path lcov-tooling.info
- uses: actions/upload-artifact@v4
with:
name: coverage-tooling
path: lcov-tooling.info
coverage-bindings:
name: Coverage Bindings
runs-on: ubuntu-latest
timeout-minutes: 30
continue-on-error: true
needs: [test-bindings]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: coverage-bindings
- run: cargo install cargo-llvm-cov --locked
- name: Generate coverage
run: |
cargo llvm-cov --all-features \
-p hedl-ffi -p hedl-wasm -p hedl-toon \
--lcov --output-path lcov-bindings.info
- uses: actions/upload-artifact@v4
with:
name: coverage-bindings
path: lcov-bindings.info
coverage-upload:
name: Upload Coverage
runs-on: ubuntu-latest
timeout-minutes: 15
if: always()
needs: [coverage-core, coverage-formats, coverage-data, coverage-tooling, coverage-bindings]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: coverage-*
merge-multiple: true
- name: Merge coverage files
run: |
if ls lcov-*.info 1> /dev/null 2>&1; then
cat lcov-*.info > lcov.info
else
echo "No coverage files found"
exit 0
fi
- uses: codecov/codecov-action@v4
if: hashFiles('lcov.info') != ''
with:
files: lcov.info
fail_ci_if_error: false
# =============================================================================
# Specialized checks
# =============================================================================
doc-tests:
name: Doc Tests
runs-on: ubuntu-latest
timeout-minutes: 20
needs: [fmt, clippy]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo test --doc --workspace
conformance:
name: SPEC Conformance
runs-on: ubuntu-latest
timeout-minutes: 20
needs: [test-core]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo test --package hedl-core conformance --all-features
benchmarks:
name: Benchmark Tests
runs-on: ubuntu-latest
timeout-minutes: 45
needs: [test-core, test-formats]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: benchmarks
- run: cargo test --benches -p hedl-bench
unsafe-audit:
name: Unsafe Audit
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for new unsafe code (PR only)
if: github.event_name == 'pull_request'
run: |
git diff origin/master...HEAD -- 'crates/hedl-core/**/*.rs' > changes.diff
if grep -q "^+.*unsafe" changes.diff; then
echo "::error::New unsafe code detected in hedl-core"
grep -n "^+.*unsafe" changes.diff
exit 1
fi
echo "No new unsafe code detected in PR"
- name: Count unsafe blocks (push events)
if: github.event_name != 'pull_request'
run: |
echo "Auditing existing unsafe code in hedl-core..."
unsafe_count=$(grep -r "unsafe" crates/hedl-core/src --include="*.rs" | wc -l || echo "0")
echo "Found ${unsafe_count} lines with 'unsafe' keyword"
if [ "$unsafe_count" -gt 0 ]; then
echo "::warning::hedl-core contains ${unsafe_count} lines with unsafe code"
grep -rn "unsafe" crates/hedl-core/src --include="*.rs" || true
else
echo "✓ hedl-core maintains zero unsafe blocks"
fi