Skip to content

ci: setup codspeed for benchmarking #170

ci: setup codspeed for benchmarking

ci: setup codspeed for benchmarking #170

Workflow file for this run

name: CI
on:
pull_request:
branches: ["main"]
types: [opened, synchronize, reopened]
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain: [stable]
target:
- default
- thumbv7em-none-eabihf
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: install libasound2-dev
run: |
if [ "${{ matrix.target }}" == "default" ]; then
sudo apt-get update
sudo apt-get install libasound2-dev
fi
- name: Set up Rust
run: |
if [ "${{ matrix.target }}" == "default" ]; then
rustup component add rustfmt
rustup component add clippy
else
rustup target add ${{ matrix.target }}
fi
- name: Print Rust version
run: rustc --version
- name: Formatter
run: |
if [ "${{ matrix.target }}" == "default" ]; then
cargo fmt -- --check
fi
- name: Build
run: |
if [ "${{ matrix.target }}" == "default" ]; then
cargo build --verbose
else
cargo build --target ${{ matrix.target }} --verbose
fi
- name: Clippy
run: |
if [ "${{ matrix.target }}" == "default" ]; then
cargo clippy --all-targets --all-features -- -D warnings
fi
- name: Run tests
run: |
if [ "${{ matrix.target }}" == "default" ]; then
cargo test --verbose
fi
- name: Run examples
run: |
if [ "${{ matrix.target }}" == "default" ]; then
cargo build --example beep
cargo build --example beep_imaadpcm
cargo build --example beep_imaadpcm_stereo
cargo build --example print_sample_values
fi