name: Rust
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
CARGO_TERM_COLOR: always
jobs:
lint:
name: Lint
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macOS-latest
runs-on: ${{ matrix.os }}
steps:
- name: Setup | Checkout
uses: actions/checkout@main
- name: Setup | Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: clippy
- name: Build | Lint
run: cargo clippy
compile:
name: Compile with Rust latest
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macOS-latest
runs-on: ${{ matrix.os }}
steps:
- name: Setup | Checkout
uses: actions/checkout@main
- name: Setup | Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: clippy
- name: Build | Compile
run: cargo check
test_on_freeBSD:
runs-on: ubuntu-latest
name: Run test on FreeBSD
strategy:
matrix:
rust:
- stable
- beta
- nightly
steps:
- uses: actions/checkout@v4
- name: Test in FreeBSD
uses: vmactions/freebsd-vm@v1
- name: Checkout code
uses: actions/checkout@main
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
- name: Build and test
run: cargo build --verbose && cargo test --verbose
test:
name: Test
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macOS-latest
rust:
- stable
- beta
- nightly
runs-on: ${{ matrix.os }}
needs: [compile]
steps:
- name: Setup | Checkout
uses: actions/checkout@main
- name: Setup | Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
- name: Build | Compile
run: cargo test