100% tests coverage for Rust version #2
This file contains hidden or 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: | |
| push: | |
| branches: | |
| - 'main' | |
| paths: | |
| - 'rust/**' | |
| - '.github/workflows/rust.yml' | |
| pull_request: | |
| branches: | |
| - 'main' | |
| paths: | |
| - 'rust/**' | |
| - '.github/workflows/rust.yml' | |
| defaults: | |
| run: | |
| working-directory: rust | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: nightly-2022-08-22 | |
| components: rustfmt | |
| - name: Run tests | |
| run: cargo test --verbose | |
| - name: Check formatting | |
| run: cargo fmt -- --check | |
| coverage: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: nightly-2022-08-22 | |
| components: llvm-tools-preview | |
| - name: Install cargo-llvm-cov | |
| uses: taiki-e/install-action@cargo-llvm-cov | |
| - name: Generate code coverage | |
| run: cargo llvm-cov --all-features --lcov --output-path lcov.info | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: rust/lcov.info | |
| fail_ci_if_error: false |