update Changelog #135
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: CI | |
| on: | |
| push: | |
| branches: ["main", "master"] | |
| pull_request: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| # π Free up disk space before building | |
| - name: Free disk space (optional but helpful) | |
| uses: jlumbroso/free-disk-space@main | |
| with: | |
| tool-cache: true | |
| large-packages: true | |
| docker-images: true | |
| swap-storage: true | |
| # π Install dependencies | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y protobuf-compiler | |
| # π Install Rust toolchain | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy, rustfmt | |
| # π Install cargo-llvm-cov for test coverage | |
| - name: Install cargo-llvm-cov | |
| run: | | |
| cargo install cargo-llvm-cov | |
| # π Cache Cargo dependencies (registry + git index) | |
| - name: Cache Cargo dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| # π Run tests with coverage instrumentation | |
| - name: Run tests with coverage | |
| run: | | |
| set -euxo pipefail | |
| cargo llvm-cov clean --workspace | |
| cargo llvm-cov --workspace --lcov --output-path lcov.info | |
| cargo llvm-cov report --summary-only | |
| # π Upload HTML coverage report as artifact | |
| - name: Upload HTML coverage report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-html | |
| path: target/llvm-cov/html | |
| # π Clean up disk after tests | |
| - name: Cleanup | |
| if: always() | |
| run: | | |
| rm -rf target | |
| df -h |