name: CI
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest, ubuntu-22.04-arm]
toolchain: [stable, nightly, "1.80.0"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
id: toolchain
with:
toolchain: ${{ matrix.toolchain }}
profile: minimal
components: rustfmt, clippy
override: true
- name: Install alsa and udev
run: sudo apt-get update; sudo apt-get install --no-install-recommends libudev-dev libx11-dev libxi-dev libgl1-mesa-dev libasound2-dev libxcb-shape0-dev libxcb-xfixes0-dev
if: runner.os == 'linux'
- name: Setup cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-test-rustc-${{ steps.toolchain.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/cargo@v1
if: runner.os == 'linux'
with:
command: fmt
args: --all -- --check
- uses: actions-rs/cargo@v1
with:
command: build
args: --lib
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0"
- uses: actions-rs/cargo@v1
if: ${{ matrix.toolchain == 'stable' || matrix.toolchain == 'nightly' }}
with:
command: build
args: --examples
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0"