name: Lint
on: [ push, pull_request ]
permissions:
contents: read
jobs:
lint:
name: Cargo clippy & fmt
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 with:
egress-policy: block
allowed-endpoints: >
archive.ubuntu.com:80
azure.archive.ubuntu.com:80
crates.io:443
esm.ubuntu.com:443
github.com:443
index.crates.io:443
motd.ubuntu.com:443
ppa.launchpadcontent.net:443
security.ubuntu.com:80
static.crates.io:443
static.rust-lang.org:443
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- name: Setup Rust toolchain
run: rustup show && rustup update
- name: cargo fmt
run: cargo fmt -- --check
- name: cargo clippy
run: cargo clippy --all-features --tests -- -D warnings
- name: cargo test
run: cargo test
check-spdx-headers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 - uses: enarx/spdx@b5bfdd4410071bf058c8333d0e70020001524b6b with:
licenses: Apache-2.0