2020-11-10 16:29:09 +00:00
|
|
|
name: Rust
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2022-09-24 08:14:53 +00:00
|
|
|
paths-ignore:
|
|
|
|
- '**.md'
|
2020-11-10 16:29:09 +00:00
|
|
|
pull_request:
|
2022-09-24 08:14:53 +00:00
|
|
|
paths-ignore:
|
|
|
|
- '**.md'
|
2020-11-10 16:29:09 +00:00
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
2024-01-10 08:26:35 +00:00
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- name: windows-latest
|
|
|
|
runs-on: [self-hosted, Windows]
|
|
|
|
self-hosted: true
|
|
|
|
- name: ubuntu-latest
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
self-hosted: false
|
|
|
|
- name: macos-latest
|
|
|
|
runs-on: macos-latest
|
|
|
|
self-hosted: false
|
|
|
|
fail-fast: false
|
|
|
|
name: ${{ matrix.name }}
|
|
|
|
runs-on: ${{ matrix.runs-on }}
|
2020-11-10 16:29:09 +00:00
|
|
|
steps:
|
2024-06-30 11:19:35 +00:00
|
|
|
- uses: actions/checkout@v4
|
2024-01-10 08:26:35 +00:00
|
|
|
- run: rustup toolchain install stable
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
|
|
if: ${{ ! matrix.self-hosted }}
|
|
|
|
with:
|
|
|
|
shared-key: ${{ matrix.name }}
|
2023-10-30 03:42:00 +00:00
|
|
|
- name: Build tests
|
2024-01-10 08:26:35 +00:00
|
|
|
run: cargo build --profile=CI --verbose --tests
|
2020-11-10 16:29:09 +00:00
|
|
|
- name: Run tests
|
2024-01-10 08:26:35 +00:00
|
|
|
run: cargo test --profile=CI --verbose
|
2023-10-30 03:42:00 +00:00
|
|
|
- name: Build examples
|
2024-01-10 08:26:35 +00:00
|
|
|
run: cargo build --profile=CI --verbose --bins
|
2024-01-05 08:08:36 +00:00
|
|
|
clippy:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-06-30 11:19:35 +00:00
|
|
|
- uses: actions/checkout@v4
|
2024-01-10 08:26:35 +00:00
|
|
|
- run: rustup toolchain install stable --component clippy
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
|
|
with:
|
|
|
|
shared-key: ubuntu-latest
|
|
|
|
save-if: "false"
|
2024-01-05 08:08:36 +00:00
|
|
|
- name: Run clippy check
|
2024-01-10 08:26:35 +00:00
|
|
|
run: cargo clippy --profile=CI -- -Dwarnings
|
2024-01-03 08:45:14 +00:00
|
|
|
fmt:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-06-30 11:19:35 +00:00
|
|
|
- uses: actions/checkout@v4
|
2024-01-10 08:26:35 +00:00
|
|
|
- run: rustup toolchain install nightly --component rustfmt
|
2024-01-05 08:08:36 +00:00
|
|
|
- name: Run fmt check
|
2024-01-10 08:26:35 +00:00
|
|
|
run: cargo +nightly fmt --check
|
2024-06-30 11:19:35 +00:00
|
|
|
typos:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Run typos
|
|
|
|
uses: crate-ci/typos@master
|