Improve project detection algorithm #901
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
env: | |
CARGO_INCREMENTAL: 0 | |
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse | |
CI: 1 | |
RUST_BACKTRACE: short | |
RUSTFLAGS: "-D warnings" | |
jobs: | |
build: | |
name: Build (${{ matrix.os }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-latest, macos-latest, ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
- name: Compile | |
run: cargo test --all-features --no-run --locked | |
- name: Test | |
run: cargo test --all-features -- --nocapture --quiet | |
msrv: | |
name: MSRV | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Extract MSRV | |
id: get-msrv | |
run: | | |
echo RUST_VERSION=$(cat Cargo.toml | grep -o "^rust-version = .*" | cut -d '=' -f2 | cut -d '"' -f2) >> $GITHUB_OUTPUT | |
- uses: dtolnay/rust-toolchain@master | |
name: Install Rust ${{ steps.get-msrv.outputs.RUST_VERSION }} | |
with: | |
toolchain: ${{ steps.get-msrv.outputs.RUST_VERSION }} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Verify minimum supported Rust version | |
run: cargo check | |
coverage: | |
name: Coverage | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: llvm-tools-preview | |
- uses: Swatinem/rust-cache@v2 | |
- uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Generate code coverage | |
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: lcov.info | |
fail_ci_if_error: true |