mirror of
https://github.com/tuono-labs/tuono
synced 2026-07-25 12:52:47 -07:00
60 lines
1.4 KiB
YAML
60 lines
1.4 KiB
YAML
name: Rust CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- '.github/**'
|
|
- 'crates/**'
|
|
pull_request:
|
|
paths:
|
|
- '.github/**'
|
|
- 'crates/**'
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
build_and_test:
|
|
name: Build and test crates on ${{ matrix.os }} with rust ${{ matrix.toolchain }}
|
|
|
|
strategy:
|
|
fail-fast: true
|
|
matrix:
|
|
os:
|
|
- 'ubuntu-latest'
|
|
- 'macos-latest'
|
|
- 'windows-latest'
|
|
toolchain:
|
|
- 'stable'
|
|
|
|
# Test `beta` and `nightly` toolchains only on `ubuntu`
|
|
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/running-variations-of-jobs-in-a-workflow#expanding-or-adding-matrix-configurations
|
|
include:
|
|
- toolchain: 'beta'
|
|
os: 'ubuntu-latest'
|
|
- toolchain: 'nightly'
|
|
os: 'ubuntu-latest'
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
|
|
- run: cargo build --verbose
|
|
- run: cargo test --verbose
|
|
|
|
lint_and_fmt:
|
|
name: Check format and lint rust crates
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- run: cargo fmt --all -- --check
|
|
- run: cargo clippy -- -D warnings
|