Skip to content

Add Windows and MacOS builds to GitHub Actions #90

Add Windows and MacOS builds to GitHub Actions

Add Windows and MacOS builds to GitHub Actions #90

Workflow file for this run

name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
ci-pass:
name: CI is green
runs-on: ubuntu-latest
needs:
- style
- test
- udeps
steps:
- run: exit 0
style:
name: Check Style
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: cargo fmt --check
run: |
if ! rustfmt --check --edition 2021 $(git ls-files '*.rs'); then
printf "Please run \`rustfmt --edition 2021 \$(git ls-files '*.rs')\` to fix rustfmt errors.\nSee CONTRIBUTING.md for more details.\n" >&2
exit 1
fi
test:
name: Test ${{ matrix.rust }} on ${{ matrix.os }}
needs:
- style
strategy:
matrix:
rust:
- stable
- beta
- nightly
os:
- ubuntu-latest
- windows-latest
- macOS-latest
include:
- rust: stable
- rust: beta
- rust: nightly
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust (${{ matrix.rust }})
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- uses: Swatinem/rust-cache@v2
- name: Test
run: cargo test ${{ matrix.features }}
udeps:
needs: [style]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
- name: Install cargo-udeps
uses: taiki-e/install-action@cargo-udeps
- uses: Swatinem/rust-cache@v2
- name: Check unused dependencies on default features
run: cargo udeps
- name: Check unused dependencies on full features
run: cargo udeps --features full