2021-03-11 07:02:24 +00:00
|
|
|
name: build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2022-05-06 16:03:56 +00:00
|
|
|
branches:
|
|
|
|
- main
|
2021-03-11 07:02:24 +00:00
|
|
|
pull_request:
|
|
|
|
|
2022-03-16 19:18:01 +00:00
|
|
|
permissions: read-all
|
|
|
|
|
2023-07-10 07:01:17 +00:00
|
|
|
env:
|
|
|
|
CARGO_INCREMENTAL: 0
|
|
|
|
CARGO_PROFILE_DEV_DEBUG: 0
|
|
|
|
|
2021-03-11 07:02:24 +00:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
2022-04-19 22:39:19 +00:00
|
|
|
fail-fast: false
|
2021-03-11 07:02:24 +00:00
|
|
|
matrix:
|
2023-07-17 18:46:11 +00:00
|
|
|
os: [ubuntu-latest, macos-13, windows-latest]
|
2023-03-29 17:22:50 +00:00
|
|
|
cargo_flags: [""]
|
2022-04-19 22:39:19 +00:00
|
|
|
include:
|
2023-03-29 16:58:29 +00:00
|
|
|
- os: ubuntu-latest
|
2023-03-29 17:22:50 +00:00
|
|
|
cargo_flags: "--all-features"
|
2022-04-19 22:39:19 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
2021-03-11 07:02:24 +00:00
|
|
|
|
|
|
|
steps:
|
2023-06-09 15:58:53 +00:00
|
|
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
|
2023-07-29 17:16:04 +00:00
|
|
|
- name: Install Rust
|
2023-06-26 15:59:54 +00:00
|
|
|
uses: dtolnay/rust-toolchain@0e66bd3e6b38ec0ad5312288c83e47c143e6b09e
|
2021-03-11 07:02:24 +00:00
|
|
|
with:
|
2023-07-29 17:16:04 +00:00
|
|
|
toolchain: 1.71
|
2021-03-11 07:02:24 +00:00
|
|
|
- name: Build
|
2023-03-29 17:22:50 +00:00
|
|
|
run: cargo build --workspace --all-targets --verbose ${{ matrix.cargo_flags }}
|
2021-03-11 07:02:24 +00:00
|
|
|
- name: Test
|
2023-03-29 17:22:50 +00:00
|
|
|
run: cargo test --workspace --all-targets --verbose ${{ matrix.cargo_flags }}
|
2021-06-14 05:06:39 +00:00
|
|
|
env:
|
|
|
|
RUST_BACKTRACE: 1
|
2021-03-23 17:30:05 +00:00
|
|
|
|
2022-12-21 19:14:46 +00:00
|
|
|
check-protos:
|
|
|
|
name: Check protos
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-06-09 15:58:53 +00:00
|
|
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
|
2023-06-26 15:59:54 +00:00
|
|
|
- uses: dtolnay/rust-toolchain@0e66bd3e6b38ec0ad5312288c83e47c143e6b09e
|
2022-12-21 19:14:46 +00:00
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
- run: sudo apt update && sudo apt-get -y install protobuf-compiler
|
|
|
|
- name: Generate Rust code from .proto files
|
|
|
|
run: cargo run -p gen-protos
|
|
|
|
- name: Check for uncommitted changes
|
|
|
|
run: git diff --exit-code
|
|
|
|
|
2022-03-08 05:02:25 +00:00
|
|
|
rustfmt:
|
|
|
|
name: Check formatting
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-06-09 15:58:53 +00:00
|
|
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
|
2023-06-26 15:59:54 +00:00
|
|
|
- uses: dtolnay/rust-toolchain@0e66bd3e6b38ec0ad5312288c83e47c143e6b09e
|
2022-03-08 05:02:25 +00:00
|
|
|
with:
|
|
|
|
toolchain: nightly
|
|
|
|
components: rustfmt
|
2023-07-11 13:08:13 +00:00
|
|
|
- run: cargo +nightly fmt --all -- --check
|
2022-03-08 05:02:25 +00:00
|
|
|
|
2022-08-22 18:33:45 +00:00
|
|
|
cargo-deny:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
checks:
|
|
|
|
- advisories
|
|
|
|
- bans licenses sources
|
|
|
|
|
|
|
|
# Prevent sudden announcement of a new advisory from failing ci:
|
|
|
|
continue-on-error: ${{ matrix.checks == 'advisories' }}
|
|
|
|
|
|
|
|
steps:
|
2023-06-09 15:58:53 +00:00
|
|
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
|
2023-07-31 15:47:38 +00:00
|
|
|
- uses: EmbarkStudios/cargo-deny-action@a50c7d5f86370e02fae8472c398f15a36e517bb8
|
2022-08-22 18:33:45 +00:00
|
|
|
with:
|
|
|
|
command: check ${{ matrix.checks }}
|
|
|
|
|
2022-05-03 21:08:55 +00:00
|
|
|
clippy-check:
|
|
|
|
name: Clippy check
|
2022-03-19 05:19:24 +00:00
|
|
|
permissions:
|
|
|
|
checks: write
|
2022-02-24 04:14:47 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-06-09 15:58:53 +00:00
|
|
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
|
2023-06-26 15:59:54 +00:00
|
|
|
- uses: dtolnay/rust-toolchain@0e66bd3e6b38ec0ad5312288c83e47c143e6b09e
|
2022-02-24 04:14:47 +00:00
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
components: clippy
|
2023-07-11 13:08:13 +00:00
|
|
|
- run: cargo +stable clippy --all-features --workspace --all-targets -- -D warnings
|