Refactoring Simulation concept #420
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: Rust checks | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
schedule: | |
- cron: '0 7 * * 1' | |
workflow_dispatch: | |
jobs: | |
check: | |
name: Check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v5 | |
- uses: prefix-dev/[email protected] | |
with: | |
pixi-version: v0.50.2 | |
cache: true | |
frozen: true | |
cache-write: ${{ github.ref == 'refs/heads/main' }} | |
environments: dev | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: "gha" | |
# Don't cache for cargo check | |
save-if: false | |
- name: Run cargo check | |
run: | | |
pixi run -e dev --frozen cargo check --workspace --locked | |
lints: | |
# Only run tests if code looks OK | |
needs: check | |
name: Lints | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v5 | |
- uses: prefix-dev/[email protected] | |
with: | |
pixi-version: v0.50.2 | |
cache: true | |
frozen: true | |
cache-write: ${{ github.ref == 'refs/heads/main' }} | |
environments: dev | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: "gha" | |
# Don't cache for cargo fmt/clippy | |
save-if: false | |
- name: Run cargo fmt | |
run: | | |
pixi run -e dev --frozen cargo fmt --all --check | |
- name: Run cargo clippy | |
run: | | |
pixi run -e dev --frozen cargo clippy --locked --all-features --tests -- -D warnings | |
test: | |
# Only run tests if code looks OK | |
needs: check | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v5 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: 1.87.0 | |
override: true | |
profile: minimal | |
- uses: prefix-dev/[email protected] | |
with: | |
pixi-version: v0.50.2 | |
cache: true | |
frozen: true | |
cache-write: ${{ github.ref == 'refs/heads/main' }} | |
environments: dev | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: "gha" | |
save-if: ${{ github.ref == 'refs/heads/main' }} | |
- run: pixi run --frozen tests-r |