name: CI
on:
push:
tags:
- "v*"
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [ published ]
workflow_dispatch:
jobs:
build:
name: Integration
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.78.0
- uses: Swatinem/rust-cache@v2
if: github.event_name != 'release' && github.event_name != 'workflow_dispatch'
- name: Build
shell: bash
run: RUSTFLAGS='-D warnings' cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Check formatting (if fails, fix with `cargo fmt`)
run: cargo fmt --all -- --check
- name: Check clippy lints
run: |
cargo clippy --workspace --bins --tests --lib --benches --examples -- -D warnings
cargo clippy --no-default-features -- -D warnings
- name: Check semver
uses: obi1kenobi/cargo-semver-checks-action@v2
publish:
name: Publish
if: startsWith( github.ref, 'refs/tags/v' )
uses: ./.github/workflows/release.yml
needs: build
secrets: inherit