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
|
|
|
|
|
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-03-29 16:58:29 +00:00
|
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
|
|
rust_version: [stable]
|
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-17 22:42:55 +00:00
|
|
|
rust_version: "1.64"
|
2023-03-29 17:22:50 +00:00
|
|
|
cargo_flags: ""
|
|
|
|
- os: ubuntu-latest
|
|
|
|
rust_version: stable
|
|
|
|
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-04-13 16:02:11 +00:00
|
|
|
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
|
2022-04-19 22:39:19 +00:00
|
|
|
- name: Install Rust (${{ matrix.rust_version }})
|
2023-02-16 16:01:38 +00:00
|
|
|
uses: dtolnay/rust-toolchain@52e69531e6f69a396bc9d1226284493a5db969ff
|
2021-03-11 07:02:24 +00:00
|
|
|
with:
|
2022-04-19 22:39:19 +00:00
|
|
|
toolchain: ${{ matrix.rust_version }}
|
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-04-13 16:02:11 +00:00
|
|
|
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
|
2023-02-16 16:01:38 +00:00
|
|
|
- uses: dtolnay/rust-toolchain@52e69531e6f69a396bc9d1226284493a5db969ff
|
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-04-13 16:02:11 +00:00
|
|
|
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
|
2023-02-16 16:01:38 +00:00
|
|
|
- uses: dtolnay/rust-toolchain@52e69531e6f69a396bc9d1226284493a5db969ff
|
2022-03-08 05:02:25 +00:00
|
|
|
with:
|
|
|
|
toolchain: nightly
|
|
|
|
components: rustfmt
|
2022-10-18 15:55:07 +00:00
|
|
|
- run: cargo 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-04-13 16:02:11 +00:00
|
|
|
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
|
2023-04-12 16:11:24 +00:00
|
|
|
- uses: EmbarkStudios/cargo-deny-action@e0a440755b184aa50374330fa75cca0f84fcb59a
|
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-04-13 16:02:11 +00:00
|
|
|
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
|
2023-02-16 16:01:38 +00:00
|
|
|
- uses: dtolnay/rust-toolchain@52e69531e6f69a396bc9d1226284493a5db969ff
|
2022-02-24 04:14:47 +00:00
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
components: clippy
|
2022-10-18 15:55:07 +00:00
|
|
|
- run: cargo clippy --all-features --workspace --all-targets -- -D warnings
|