Update CI workflows for consistency and performance #32
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: Cross-Platform Tests | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| jobs: | |
| build-and-test: | |
| name: Build and Test | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| if: runner.os == 'linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libudev-dev | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| profile: minimal | |
| toolchain: stable | |
| override: true | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Build | |
| run: cargo build | |
| working-directory: . | |
| - name: Run unit tests | |
| run: cargo test --lib --bins | |
| working-directory: . | |
| - name: Run e2e tests | |
| run: cargo test --test "*" | |
| working-directory: . | |
| continue-on-error: true | |
| - name: Rust Release binary | |
| # You may pin to the exact commit or the version. | |
| # uses: rust-build/rust-build.action@6febf1b0ed6499a46610b58ef9d810398e75f3c2 | |
| uses: rust-build/[email protected] | |
| with: | |
| RUSTTARGET: "osvm" |