name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Build and Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Install system dependencies (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libxcb-shape0-dev libxcb-xfixes0-dev
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Check formatting (Unix only)
if: matrix.os != 'windows-latest'
run: cargo fmt --all -- --check
- name: Lint with Clippy
run: cargo clippy --all-targets -- -D warnings
- name: Check build
run: cargo build --release
- name: Install Nix
if: matrix.os != 'windows-latest'
uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Build with Nix
if: matrix.os != 'windows-latest'
run: nix build