Skip to content

Cargo Tests

Cargo Tests #664

Workflow file for this run

name: Cargo Tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '09 06 * * *'
jobs:
test_linux:
name: Test Linux
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- name: Install developer package dependencies
run: sudo apt-get update && sudo apt-get install libasound2-dev
- uses: Swatinem/rust-cache@v1
- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
- name: Build
run: cargo build
- name: Run tests
run: cargo test
test_macos:
name: Test Mac
strategy:
matrix:
os: [macos-latest]
rust: [stable]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt
- uses: Swatinem/rust-cache@v1
- name: Run cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install latest stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- name: Enforce formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --check