Nix in CI + Fix macOS #191
This file contains 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
on: | |
push: | |
branches: [ "*" ] | |
pull_request: | |
branches: [ "*" ] | |
name: Test | |
jobs: | |
build: | |
name: Test/Cargo | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
features: [""] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: Install dependencies | |
run: rustup component add rustfmt | |
- name: Check | |
uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
- name: Test | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
- name: Format | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
- name: Readme | |
run: | | |
cargo install cargo-rdme | |
cargo rdme --check | |
nix: | |
name: Test/Nix (${{ matrix.system.nix }}) | |
strategy: | |
matrix: | |
system: | |
[ | |
{ gha: ubuntu-latest, nix: "x86_64-linux" }, | |
{ gha: macos-13, nix: "x86_64-darwin" }, | |
{ gha: macos-14, nix: "aarch64-darwin" }, | |
] | |
runs-on: ${{ matrix.system.gha }} | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v3 | |
- uses: DeterminateSystems/nix-installer-action@main | |
- uses: DeterminateSystems/magic-nix-cache-action@main | |
- run: nix build | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
permissions: | |
checks: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
components: clippy | |
override: true | |
- uses: actions-rs/clippy-check@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
args: --all-features | |
name: Clippy Output |