Skip to content

Commit

Permalink
add cargo deny to CI (#1285)
Browse files Browse the repository at this point in the history
* check duplicate dependencies
* also use cargo-deny for licenses checking
* also run cargo deny check in make check
  • Loading branch information
extrawurst authored Aug 17, 2022
1 parent d4949a6 commit 6630dca
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 3 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ jobs:
run: |
make test-linux-musl
rustfmt:
name: Formatting
linting:
name: Lints
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
Expand All @@ -128,13 +128,26 @@ jobs:
with:
toolchain: stable
components: rustfmt

- run: cargo fmt -- --check

- name: cargo-sort
run: |
cargo install cargo-sort --force
cargo sort -c -w
- name: cargo-deny install
run: |
cargo install --locked cargo-deny
- name: cargo-deny licenses
run: |
cargo deny check licenses
- name: cargo-deny bans
run: |
cargo deny check bans
sec:
name: Security audit
runs-on: ubuntu-latest
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ clippy:
clippy-nightly:
cargo +nightly clippy --workspace --all-features

check: fmt clippy test
check: fmt clippy test deny

deny:
cargo deny check

install:
cargo install --path "." --offline
Expand Down
20 changes: 20 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[licenses]
unlicensed = "deny"
allow = [
"MIT",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
]
copyleft = "warn"
allow-osi-fsf-free = "neither"
default = "deny"
confidence-threshold = 0.9

[[licenses.exceptions]]
allow = ["Unicode-DFS-2016"]
name = "unicode-ident"
version = "1.0.3"

[bans]
multiple-versions = "deny"

0 comments on commit 6630dca

Please sign in to comment.