Skip to content

Add concise macOS troubleshooting notes for common install/runtime issues. #493

Add concise macOS troubleshooting notes for common install/runtime issues.

Add concise macOS troubleshooting notes for common install/runtime issues. #493

Workflow file for this run

name: Rust checks
on:
push:
branches: [main]
tags:
- 'c*.*.*'
- 'd*.*.*'
pull_request:
paths:
- crates/**
- Cargo.toml
- Cargo.lock
- .github/workflows/ci-rust.yml
- pyproject.toml
- pixi.lock
schedule:
- cron: '0 5 * * 1'
jobs:
check:
name: Rust - Check
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v5
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.50.2
frozen: true
cache: true
cache-write: ${{ github.ref == 'refs/heads/main' }}
environments: pdev rdev
- uses: Swatinem/rust-cache@v2
with:
shared-key: "gha"
# Don't save cache for cargo check!
save-if: false
- name: Run cargo check
run: |
pixi run -e rdev --frozen cargo check --workspace --locked
lints:
# Only run tests if code looks OK
needs: check
name: Rust - Lint
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v5
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.50.2
frozen: true
cache: true
cache-write: ${{ github.ref == 'refs/heads/main' }}
environments: pdev rdev
- uses: Swatinem/rust-cache@v2
with:
shared-key: "gha"
# Don't save cache for cargo fmt or clippy!
save-if: false
- name: Run cargo fmt
run: |
pixi run -e rdev --frozen cargo fmt --all --check
- name: Run cargo clippy
run: |
pixi run -e rdev --frozen cargo clippy --locked --all-features --tests -- -D warnings
test:
# Only run tests if code looks OK
needs: check
name: Rust - Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v5
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.50.2
frozen: true
cache: true
cache-write: ${{ github.ref == 'refs/heads/main' }}
environments: pdev rdev
- uses: Swatinem/rust-cache@v2
with:
shared-key: "gha"
save-if: ${{ github.ref == 'refs/heads/main' }}
- run: pixi run -e rdev --frozen tests-r
publish-dry:
name: Rust - Publish (dry-run)
# Only run tests if code looks OK
needs: check
runs-on: ubuntu-latest
if: ${{ !startsWith(github.ref, 'refs/heads/main') && !startsWith(github.ref, 'refs/tags/c') && !startsWith(github.ref, 'refs/tags/d') }}
steps:
- name: Checkout sources
uses: actions/checkout@v5
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.50.2
frozen: true
cache: true
cache-write: ${{ github.ref == 'refs/heads/main' }}
environments: rdev
- uses: Swatinem/rust-cache@v2
with:
shared-key: "gha"
save-if: false
- name: Publish crates (DB)
run: |
pixi run -e rdev --frozen publish-db --dry-run
- name: Publish crates (CLI)
run: |
pixi run -e rdev --frozen publish-cli --dry-run
publish-cli:
name: Publish Rust CLI crate
# Only publish if tests pass
needs: test
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/c')
steps:
- name: Checkout sources
uses: actions/checkout@v5
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.50.2
frozen: true
cache: true
cache-write: ${{ github.ref == 'refs/heads/main' }}
environments: rdev
- uses: Swatinem/rust-cache@v2
with:
shared-key: "gha"
save-if: false
- name: Publish crates (CLI)
run: |
pixi run -e rdev --frozen publish-cli
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
publish-db:
name: Publish Rust DB crate
# Only publish if tests pass
needs: test
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/d')
steps:
- name: Checkout sources
uses: actions/checkout@v5
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.50.2
frozen: true
cache: true
cache-write: ${{ github.ref == 'refs/heads/main' }}
environments: rdev
- uses: Swatinem/rust-cache@v2
with:
shared-key: "gha"
save-if: false
- name: Publish crates (DB)
run: |
pixi run -e rdev --frozen publish-db
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}