Skip to content

Commit

Permalink
Check for duplicate dependencies in CI (#172)
Browse files Browse the repository at this point in the history
* Setup dependencies CI

* eof

* Remove bors stuff

* Ignoring packages in dev-dependencies

* Update deny.toml

* Update deny.toml
  • Loading branch information
Weibye committed Jun 17, 2022
1 parent 03fc090 commit a753f29
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Dependencies

on:
pull_request:
paths:
- '**/Cargo.toml'
- 'deny.toml'
push:
paths:
- '**/Cargo.toml'
- 'deny.toml'
branches-ignore:
- 'dependabot/**'
# schedule:
# - cron: "0 0 * * 0"

env:
CARGO_TERM_COLOR: always

jobs:
check-advisories:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install cargo-deny
run: cargo install cargo-deny
- name: Check for security advisories and unmaintained crates
run: cargo deny check advisories

check-bans:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install cargo-deny
run: cargo install cargo-deny
- name: Check for banned and duplicated dependencies
run: cargo deny check bans

check-licenses:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install cargo-deny
run: cargo install cargo-deny
- name: Check for unauthorized licenses
run: cargo deny check licenses

check-sources:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install cargo-deny
run: cargo install cargo-deny
- name: Checked for unauthorized crate sources
run: cargo deny check sources
41 changes: 41 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[advisories]
db-path = "~/.cargo/advisory-db"
db-urls = ["https://github.com/rustsec/advisory-db"]
vulnerability = "deny"
unmaintained = "deny"
yanked = "deny"
notice = "deny"
ignore = [
"RUSTSEC-2021-0127" # from serde_cbor
]

[licenses]
unlicensed = "deny"
copyleft = "deny"
allow = [
"MIT",
"MIT-0",
"Apache-2.0",
"BSD-3-Clause",
"ISC",
"Zlib",
"0BSD",
"BSD-2-Clause",
"CC0-1.0",
]
default = "deny"

[bans]
multiple-versions = "deny"
wildcards = "deny"
highlight = "all"
# Certain crates/versions that will be skipped when doing duplicate detection.
skip = [
{ name = "itoa", version = "1.0.2" }
]

[sources]
unknown-registry = "deny"
unknown-git = "deny"
allow-registry = ["https://github.com/rust-lang/crates.io-index"]
allow-git = []

0 comments on commit a753f29

Please sign in to comment.