Rust checks #886
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 checks | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| schedule: | |
| - cron: '0 5 * * 5' | |
| jobs: | |
| check: | |
| name: Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v6 | |
| - uses: prefix-dev/setup-pixi@v0.9.3 | |
| with: | |
| pixi-version: v0.57.0 | |
| cache: true | |
| frozen: true | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| save-if: ${{ github.ref == 'refs/heads/main' }} | |
| - name: Run cargo check | |
| run: | | |
| pixi run --frozen cargo check --workspace | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| build: [beta, stable, windows, macos] | |
| include: | |
| - build: macos | |
| os: macos-latest | |
| rust: stable | |
| - build: windows | |
| os: windows-latest | |
| rust: stable | |
| - build: beta | |
| os: ubuntu-latest | |
| rust: beta | |
| - build: stable | |
| os: ubuntu-latest | |
| rust: stable | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: ${{ matrix.rust }} | |
| override: true | |
| - uses: prefix-dev/setup-pixi@v0.9.3 | |
| with: | |
| pixi-version: v0.57.0 | |
| cache: true | |
| frozen: true | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| save-if: ${{ github.ref == 'refs/heads/main' }} | |
| - name: Run tests | |
| run: | | |
| pixi run --frozen cargo test --no-fail-fast | |
| publish: | |
| name: Publish (dry-run) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v6 | |
| - uses: prefix-dev/setup-pixi@v0.9.3 | |
| with: | |
| pixi-version: v0.57.0 | |
| cache: true | |
| frozen: true | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| save-if: ${{ github.ref == 'refs/heads/main' }} | |
| - name: Make sure we can publish | |
| run: | | |
| pixi run --frozen cargo publish --dry-run |