Skip to content

Intro Release Setup #442

Intro Release Setup

Intro Release Setup #442

Workflow file for this run

name: Validate
on:
push:
branches:
- main
pull_request:
concurrency:
group: validate-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: 1
jobs:
rust:
name: Rust
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
# Setup Rust toolchain
- run: |
rustup toolchain install nightly --component rustfmt
rustup component add llvm-tools-preview
# Cache dependencies and build artifacts
- uses: swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
cache-provider: "github"
# Add custom matcher for cargo output
- run: echo "::add-matcher::.github/matcher/cargo.json"
- name: Check formatting
run: cargo +nightly fmt --check
- name: Lint
run: cargo clippy -- -D warnings
# Run tests with coverage instrumentation
- name: Test
run: cargo test
env:
RUSTFLAGS: -C instrument-coverage
LLVM_PROFILE_FILE: test-%p-%m.profraw
# Convert and upload coverage report
- run: cargo install --locked grcov
- run: grcov . -s . --binary-path ./target/debug/ --branch --ignore-not-existing -t lcov -o ./lcov.info
- name: Upload coverage report
uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d # v5.4.2
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
fail_ci_if_error: true
dependencies:
runs-on: ubuntu-latest
strategy:
matrix:
checks:
- advisories
- bans licenses sources
# NOTE: Prevent sudden announcement of a new advisory from failing ci
continue-on-error: ${{ matrix.checks == 'advisories' }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
- uses: EmbarkStudios/cargo-deny-action@34899fc7ba81ca6268d5947a7a16b4649013fea1 #v2.0.11
with:
command: check ${{ matrix.checks }}
python:
runs-on: ubuntu-latest
strategy:
matrix:
projects: ["drivers/hypha-accelerate-driver", "drivers/aim-driver"]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
- uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba #v6.3.1
with:
working-directory: ${{ matrix.projects }}
enable-cache: true
# We want a per-project cache and assume that each one uses 'uv'.
# Furthermore, the symbolic links in the project causes '**' globs to fail.
cache-dependency-glob: |
python/${{ matrix.projects }}/pyproject.toml
python/${{ matrix.projects }}/uv.lock
- name: Check formatting
run: uv run --frozen ruff format --check .
working-directory: ${{ matrix.projects }}
- name: Linting
run: uv run --frozen ruff check .
working-directory: ${{ matrix.projects }}
- name: Check types
run: uv run --frozen mypy .
working-directory: ${{ matrix.projects }}