2024-01-03 10:24:52 +00:00
|
|
|
# Based on https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md
|
|
|
|
#
|
|
|
|
# While our "example" application has the platform-specific code,
|
|
|
|
# for simplicity we are compiling and testing everything on the Ubuntu environment only.
|
|
|
|
# For multi-OS testing see the `cross.yml` workflow.
|
|
|
|
|
|
|
|
name: rust
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ main ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ main ]
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
check:
|
|
|
|
name: check
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
2024-01-29 08:25:04 +00:00
|
|
|
- name: Setup Rust (cache & toolchain)
|
|
|
|
uses: ./.github/actions/setup-rust
|
2024-01-03 10:24:52 +00:00
|
|
|
- name: Run cargo check
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: check
|
2024-01-29 08:25:04 +00:00
|
|
|
args: --release
|
2024-01-03 10:24:52 +00:00
|
|
|
|
|
|
|
test:
|
|
|
|
name: test
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
2024-01-29 08:25:04 +00:00
|
|
|
- name: Setup Rust (cache & toolchain)
|
|
|
|
uses: ./.github/actions/setup-rust
|
2024-01-03 10:24:52 +00:00
|
|
|
- name: Run cargo test
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: test
|
|
|
|
args: --release
|
|
|
|
|
|
|
|
lints:
|
|
|
|
name: lints
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
2024-01-29 08:25:04 +00:00
|
|
|
- name: Setup Rust (cache & toolchain)
|
|
|
|
uses: ./.github/actions/setup-rust
|
2024-01-03 10:24:52 +00:00
|
|
|
- name: Run cargo fmt
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: fmt
|
|
|
|
args: --all -- --check
|
|
|
|
- name: Run cargo clippy
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
2024-01-26 11:48:40 +00:00
|
|
|
command: clippy
|
2024-06-29 09:08:02 +00:00
|
|
|
# blocks_in_conditions is triggered for tracing::instrument.
|
|
|
|
# This can be removed after the fix is released.
|
2024-01-26 11:48:40 +00:00
|
|
|
args: -- -D warnings
|