Skip to content

Use preinstalled rust & CARGO_INCREMENTAL=0 #1912

Use preinstalled rust & CARGO_INCREMENTAL=0

Use preinstalled rust & CARGO_INCREMENTAL=0 #1912

Workflow file for this run

on: [push, pull_request]
name: Basic CI
jobs:
check:
name: cargo check
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v6
# For bindgen: https://github.com/rust-lang/rust-bindgen/issues/1797
- uses: KyleMayes/install-llvm-action@v2
if: matrix.os == 'windows-latest'
with:
version: "11.0"
directory: ${{ runner.temp }}/llvm
- run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV
if: matrix.os == 'windows-latest'
- name: Check
env:
CARGO_INCREMENTAL: 0
run: |
cargo check --all --all-features
test:
name: cargo test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v6
# For bindgen: https://github.com/rust-lang/rust-bindgen/issues/1797
- uses: KyleMayes/install-llvm-action@v2
if: matrix.os == 'windows-latest'
with:
version: "11.0"
directory: ${{ runner.temp }}/llvm
- run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV
if: matrix.os == 'windows-latest'
- name: Test
env:
CARGO_INCREMENTAL: 0
run: |
cargo test
fmt:
name: cargo fmt --all -- --check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: rustup component add rustfmt
- name: cargo fmt
env:
CARGO_INCREMENTAL: 0
run: |
cargo fmt --all -- --check
clippy:
name: cargo clippy -- -D warnings
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: rustup component add clippy
- name: cargo clippy
env:
CARGO_INCREMENTAL: 0
run: |
cargo clippy --all-targets -- -D warnings
grcov:
name: Code coverage
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
toolchain:
- nightly
cargo_flags:
- "--all-features"
steps:
- name: Checkout source code
uses: actions/checkout@v6
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
env:
CARGO_INCREMENTAL: 0
RUSTC_BOOTSTRAP: 1
run: |
cargo llvm-cov --all-features --lcov --branch --output-path lcov.info
- name: Upload coverage as artifact
uses: actions/upload-artifact@v7
with:
name: lcov.info
path: lcov.info
- name: Upload coverage to codecov.io
uses: codecov/codecov-action@v5
with:
files: lcov.info
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}