name: Rust CI Pipeline
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
CARGO_TERM_COLOR: always
RUST_MIN_STACK: 67108864
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Check formatting
run: cargo fmt -- --check
- name: Run clippy
run: cargo clippy -- -D warnings
- name: Run tests
run: RUST_BACKTRACE=full cargo test --verbose
coverage:
needs: build
name: coverage
runs-on: ubuntu-latest
container:
image: xd009642/tarpaulin:develop-nightly
options: --security-opt seccomp=unconfined
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Generate code coverage
run: |
cargo +nightly tarpaulin --verbose --engine llvm --all-features --workspace --out Lcov
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: "lcov.info"
build-i686:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install 32-bit support
run: sudo apt-get update && sudo apt-get install -y gcc-multilib
- name: Add i686 target
run: rustup target add i686-unknown-linux-gnu
- name: Build (32-bit)
run: cargo build --target i686-unknown-linux-gnu
- name: Test (32-bit)
run: cargo test --target i686-unknown-linux-gnu