ci(release): Migrate to cargo-dist and overhaul CI #888
Workflow file for this run
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: [master] | |
| pull_request: | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| rust: | |
| - stable | |
| - beta | |
| - nightly | |
| - 1.87.0 # minimum supported version | |
| continue-on-error: ${{ matrix.rust == 'nightly' }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: ${{ matrix.rust}} | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: ci-test-${{ runner.os }}-${{ matrix.rust }} | |
| cache-workspace-crates: "true" | |
| - name: Build | |
| run: cargo build --all-features | |
| - name: Cargo Test | |
| run: cargo test --workspace --all-features | |
| - name: Run unit-tests | |
| run: tests/run_all.sh | |
| shell: bash | |
| test-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: ci-test-windows-${{ runner.os }}-stable | |
| cache-workspace-crates: "true" | |
| - name: Build | |
| run: cargo build --all-features | |
| - name: Cargo Test | |
| run: cargo test --workspace --all-features | |
| - name: Run unit-tests | |
| run: tests/run_all.sh | |
| shell: bash | |
| test-macos: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: ci-test-macos-${{ runner.os }}-stable | |
| cache-workspace-crates: "true" | |
| - name: Build | |
| run: cargo build --all-features | |
| - name: Cargo Test | |
| run: cargo test --workspace --all-features | |
| - name: Run unit-tests | |
| run: tests/run_all.sh | |
| shell: bash | |
| release-build: | |
| name: Release Build (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - windows-latest | |
| - macos-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: ci-release-build-${{ runner.os }}-stable | |
| cache-workspace-crates: "true" | |
| - name: Build (release) | |
| run: cargo build --release --all-features | |
| clippy_check: | |
| name: Clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: stable | |
| components: clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: ci-clippy-${{ runner.os }}-stable | |
| cache-workspace-crates: "true" | |
| - run: cargo clippy --all-features | |
| unused-deps: | |
| name: Unused Dependencies | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: ci-unused-deps-${{ runner.os }}-stable | |
| cache-workspace-crates: "true" | |
| - name: Install machete | |
| run: cargo install cargo-machete | |
| - name: Check for unused dependencies | |
| run: cargo machete |