name: CI
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
RUST_BACKTRACE: short
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1
CARGO_PROFILE_DEV_DEBUG: 0
jobs:
formatting:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check formatting
run: cargo fmt --all --check
checks:
name: Checks [${{ matrix.os }}]
runs-on: ${{ matrix.runner }}
needs: formatting
strategy:
fail-fast: false
matrix:
os: [windows, linux, macos]
include:
- os: windows
runner: windows-latest
- os: linux
runner: ubuntu-latest
- os: macos
runner: macos-latest
steps:
- uses: actions/checkout@v4
- name: Rust cache
uses: Swatinem/rust-cache@v2.8.2
- name: Lints
run: cargo clippy --workspace --all-features --tests --locked -v -- -Dwarnings
- name: Tests
run: cargo test --workspace -v
success:
name: Success
runs-on: ubuntu-latest
if: ${{ always() }}
needs:
- formatting
- checks
steps:
- name: CI succeeded
id: succeeded
if: ${{ !contains(needs.*.result, 'failure') }}
run: exit 0
- name: CI failed
if: ${{ steps.succeeded.outcome == 'skipped' }}
run: exit 1