Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI #264

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 64 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,79 @@
# Adapted from https://github.com/bevyengine/bevy_github_ci_template
name: CI

on:
pull_request:
branches: [master]
push:
branches: [master]
pull_request:
branches: [master]

env:
CARGO_TERM_COLOR: always

jobs:

build:
strategy:
matrix:
toolchain: [stable, nightly]
os: [windows-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
# Run cargo test
test:
name: Test Suite
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@master
- name: Checkout sources
uses: actions/checkout@v4
- name: Cache
uses: actions/cache@v4
with:
toolchain: ${{ matrix.toolchain }}
components: rustfmt, clippy
- name: fmt
if: ${{ matrix.toolchain == 'nightly' && runner.os == 'linux' }}
run: cargo fmt --all -- --check

- name: Install alsa and udev
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.toml') }}
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install Dependencies
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
if: runner.os == 'linux'

- name: lint
uses: actions-rs/clippy-check@v1
- name: Run cargo test
run: cargo test

# Run cargo clippy -- -D warnings
clippy_check:
name: Clippy
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.toml') }}
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-targets --all-features -- -D warnings -A unknown-lints
components: clippy
- name: Install Dependencies
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
- name: Run clippy
run: cargo clippy -- -D warnings

- name: Build & run tests
run: cargo test --workspace
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 -D warnings"
# Run cargo fmt --all -- --check
format:
name: Format
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@nightly # Unstable formatter options used.
with:
components: rustfmt
- name: Run cargo fmt
run: cargo fmt --all -- --check
Loading