Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup dependencies CI #172

Merged
merged 6 commits into from
Jun 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = []