Skip to content

Bump the cargo group across 3 directories with 31 updates #1837

Bump the cargo group across 3 directories with 31 updates

Bump the cargo group across 3 directories with 31 updates #1837

Workflow file for this run

name: Test and Check
on:
push:
branches: [ main ]
pull_request:
merge_group:
branches:
- main
workflow_call:
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v5
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: thumbv7em-none-eabihf
components: rustfmt, clippy, llvm-tools
override: true
- name: Build no-std
uses: actions-rs/cargo@v1
with:
command: build
toolchain: stable
args: --no-default-features
- name: Build stm32
working-directory: statime-stm32
run: cargo build
# Build std is handled by test job
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v5
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov
- name: Run tests
run: cargo llvm-cov --all-features --lcov --output-path lcov.info
env:
RUST_BACKTRACE: 1
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: false
check:
name: Check style
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v5
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
override: true
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
toolchain: stable
args: --all --check
- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
toolchain: stable
args: --workspace --all-features -- -D warnings
- name: Run clippy (fuzzers)
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
with:
command: clippy
args: --manifest-path ./fuzz/Cargo.toml --all-targets -- -D warnings
fuzz:
name: Smoke-test fuzzing targets
runs-on: ubuntu-latest
strategy:
matrix:
include:
- fuzz_target: message_sound
corpus: ""
features: ''
steps:
- name: Checkout sources
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
with:
persist-credentials: false
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
with:
toolchain: nightly
components: llvm-tools-preview
- name: Install cargo fuzz & rustfilt
uses: taiki-e/install-action@d6912b47771be2c443ec90dbb3d28e023987e782
with:
tool: cargo-fuzz,rustfilt
- name: Run `cargo fuzz`
env:
RUST_BACKTRACE: "1"
# prevents `cargo fuzz coverage` from rebuilding everything
RUSTFLAGS: "-C instrument-coverage"
run: |
cargo fuzz run --target $(rustc --print host-tuple) ${{matrix.features}} ${{matrix.fuzz_target}} ${{matrix.corpus}} -- -max_total_time=10
- name: Fuzz codecov
run: |
cargo fuzz coverage --target $(rustc --print host-tuple) ${{matrix.features}} ${{matrix.fuzz_target}} ${{matrix.corpus}}
$(rustc --print sysroot)/lib/rustlib/$(rustc --print host-tuple)/bin/llvm-cov export -Xdemangler=rustfilt \
target/x86_64-unknown-linux-musl/coverage/$(rustc --print host-tuple)/release/${{matrix.fuzz_target}} \
-instr-profile=fuzz/coverage/${{matrix.fuzz_target}}/coverage.profdata \
--format=lcov \
-ignore-filename-regex="\.cargo|\.rustup" > lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7
with:
files: ./lcov.info
fail_ci_if_error: false
flags: fuzz, fuzz-${{ matrix.fuzz_target }}
token: ${{ secrets.CODECOV_TOKEN }}
name: fuzz