rust #1032
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: rust | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: "00 01 * * *" | |
jobs: | |
check: | |
name: Check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- run: | | |
cargo check --locked | |
test: | |
name: Test Suite | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Install nextest | |
uses: taiki-e/install-action@nextest | |
- run: | | |
cargo nextest run --release | |
fmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- run: | | |
cargo fmt --all -- --check | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- run: | | |
cargo clippy --locked -- -D warnings | |
coverage: | |
name: coverage | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Install Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Install `cargo-llvm-cov` | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Measure code coverage for all tests | |
run: | | |
# Fail if any tests fail | |
set -e | |
set -o pipefail | |
cargo llvm-cov --all-features --workspace --codecov --output-path codecov.json | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: codecov.json | |
flags: all-tests | |
fail_ci_if_error: true | |
lustre-coverage: | |
name: lustre-coverage | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
lustre_version: ["2_14_0_ddn133", "2_14_0_ddn145"] | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Install Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Install `cargo-llvm-cov` | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Measure code coverage for specific lustre version ${{ matrix.lustre_version }} | |
run: | | |
# Fail if any tests fail | |
set -e | |
set -o pipefail | |
cargo llvm-cov --codecov --output-path codecov_${{ matrix.lustre_version }}.json --package lustre_collector --lib -- parser::tests::test_lustre_${{ matrix.lustre_version }}_fixtures | |
- name: Upload coverage for specific lustre version ${{ matrix.lustre_version }} | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: codecov_${{ matrix.lustre_version }}.json | |
flags: ${{ matrix.lustre_version }} | |
fail_ci_if_error: true |