name: Rust Build
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: cargo check/test/build (${{ matrix.feature }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
feature: [default, hyprland, mutation]
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- name: Install Rust (stable)
run: rustup toolchain install stable --profile minimal --no-self-update
- name: Cache cargo build artifacts and registry
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.feature }}
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Cargo check (default)
if: ${{ matrix.feature == 'default' }}
run: cargo check --no-default-features --features mutation
- name: Cargo check (hyprland)
if: ${{ matrix.feature == 'hyprland' }}
run: cargo check --no-default-features --features hyprland,mutation
- name: Cargo check (mutation)
if: ${{ matrix.feature == 'mutation' }}
run: cargo check --no-default-features --features mutation
- name: Cargo test (default)
if: ${{ matrix.feature == 'default' }}
run: cargo test mutation --no-default-features --features mutation
- name: Cargo test (hyprland)
if: ${{ matrix.feature == 'hyprland' }}
run: cargo test --no-default-features --features hyprland,mutation
- name: Cargo test (mutation)
if: ${{ matrix.feature == 'mutation' }}
run: cargo test --no-default-features --features mutation
- name: Cargo build (release, default)
if: ${{ matrix.feature == 'default' }}
run: cargo build --release --no-default-features --features mutation
- name: Cargo build (release, hyprland)
if: ${{ matrix.feature == 'hyprland' }}
run: cargo build --release --no-default-features --features mutation,hyprland
- name: Cargo build (release, mutation)
if: ${{ matrix.feature == 'mutation' }}
run: cargo build --release --no-default-features --features mutation