100 lines
2.5 KiB
YAML
100 lines
2.5 KiB
YAML
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
|
|
name: Test Suite
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
required:
|
|
runs-on: ubuntu-latest
|
|
name: ubuntu / ${{ matrix.toolchain }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
toolchain: [stable, beta]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install ${{ matrix.toolchain }}
|
|
uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: ${{ matrix.toolchain }}
|
|
|
|
- name: cargo generate-lockfile
|
|
if: hashFiles('Cargo.lock') == ''
|
|
run: cargo generate-lockfile
|
|
|
|
- name: cargo test --locked
|
|
run: cargo test --locked --all-features --all-targets
|
|
|
|
os-check:
|
|
runs-on: ${{ matrix.os }}
|
|
name: ${{ matrix.os }} / stable
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [macos-latest, windows-latest]
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Ensure TMPDIR is valid for MacOS
|
|
if: runner.os == 'macOS'
|
|
run: |
|
|
echo "TMPDIR=$RUNNER_TEMP" >> $GITHUB_ENV
|
|
|
|
- name: Install Rust stable
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: cargo generate-lockfile
|
|
if: hashFiles('Cargo.lock') == ''
|
|
run: cargo generate-lockfile
|
|
|
|
- name: cargo test
|
|
run: cargo test --locked --all-features --all-targets
|
|
|
|
- name: Cache Cargo dependencies
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
coverage:
|
|
runs-on: ubuntu-latest
|
|
name: ubuntu / stable / coverage
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Rust stable
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: llvm-tools-preview
|
|
|
|
- name: cargo install cargo-llvm-cov
|
|
uses: taiki-e/install-action@cargo-llvm-cov
|
|
|
|
- name: cargo generate-lockfile
|
|
if: hashFiles('Cargo.lock') == ''
|
|
run: cargo generate-lockfile
|
|
|
|
- name: cargo llvm-cov
|
|
run: cargo llvm-cov --locked --all-features --lcov --output-path lcov.info
|
|
|
|
- name: Record Rust version
|
|
run: echo "RUST=$(rustc --version)" >> "$GITHUB_ENV"
|
|
|
|
- name: Cache Cargo dependencies
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
- name: Upload to codecov.io
|
|
if: env.ACT != 'true'
|
|
uses: codecov/codecov-action@v5
|
|
with:
|
|
fail_ci_if_error: true
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
env_vars: OS,RUST
|