Skip to content

Commit

Permalink
More robust CI
Browse files Browse the repository at this point in the history
Since CI usage is free for public repos, why not go all out for test validation!
  • Loading branch information
QueenOfSquiggles committed Aug 10, 2024
1 parent a70d4fe commit 5365ebe
Showing 1 changed file with 41 additions and 13 deletions.
54 changes: 41 additions & 13 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,50 @@
name: Rust
name: CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
on: [push, pull_request, workflow_dispatch]

env:
CARGO_TERM_COLOR: always

jobs:
build:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
toolchain: [stable, nightly, "1.71.1"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2

runs-on: ubuntu-latest
- uses: actions-rs/toolchain@v1
id: toolchain
with:
toolchain: ${{ matrix.toolchain }}
profile: minimal
components: rustfmt, clippy
override: true

steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Install alsa and udev
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
if: runner.os == 'linux'

- name: Setup cache
uses: actions/cache@v2
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
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0"

0 comments on commit 5365ebe

Please sign in to comment.