-
Notifications
You must be signed in to change notification settings - Fork 12
ci: replace cargo-audit with cargo-deny advisories #694
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| name: Dependencies | ||
|
|
||
| on: | ||
| # Unfiltered: a run skipped by a path filter reports no conclusion, which would | ||
| # leave `dependencies:required` pending forever on every unrelated PR. | ||
| pull_request: | ||
| # Backstop for weeks with no PRs. Advisories are the one finding here that can | ||
| # appear with no change on our side, so re-check against the RustSec database. | ||
| schedule: | ||
| - cron: "0 14 * * 1" | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| # When getting Rust dependencies, retry on network error: | ||
| CARGO_NET_RETRY: 10 | ||
|
|
||
| jobs: | ||
| cargo-deny: | ||
| name: dependencies:required | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| # rust-toolchain.toml is left in place so the graph is resolved by the same | ||
| # cargo that builds our releases. It costs ~30s of toolchain install, and | ||
| # buys us not depending on the action image's Rust being new enough. | ||
| - uses: EmbarkStudios/cargo-deny-action@3fd3802e88374d3fe9159b834c7714ec57d6c979 # v2.0.15 | ||
| with: | ||
| command: check advisories bans licenses sources | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1,53 @@ | ||
| # adapted from https://github.com/dfinity-lab/common/blob/master/pkgs/overlays/packages/cargo-deny/buildtime.toml | ||
| # for context, see https://github.com/dfinity-lab/common/blob/master/pkgs/overlays/packages/cargo-deny/runtime.toml | ||
| # we allow more licenses in the build-time check. all rust dependencies are statically linked, | ||
| # so copyleft licenses like MPL which allow static linking are A-OK | ||
| # Dependency policy for icp-cli, enforced by the Dependencies workflow. icp-cli | ||
| # ships a linked binary, so these rules cover what we may distribute rather than | ||
| # obligations passed to downstream crates (cf. dfinity/candid). | ||
|
|
||
| [graph] | ||
| # Dev-only deps never reach the released binary. Explicit so a changed default | ||
| # cannot silently widen the graph. | ||
| exclude-dev = true | ||
|
|
||
| [advisories] | ||
| # Vulnerabilities are always denied. Informational advisories are transitive | ||
| # crates we do not pick, usually with no patched version, and GHSA omits them so | ||
| # Dependabot never raises them either. Replaces the stale hand-maintained ignore | ||
| # list in .cargo/audit.toml. | ||
| unmaintained = "none" | ||
| # Not a vulnerability, and usually clears on the next `cargo update`. | ||
| yanked = "warn" | ||
|
|
||
| [licenses] | ||
| # Binary distribution, so: attribution-only terms, plus MPL-2.0, whose copyleft | ||
| # is file-scoped and we modify none of those files. Strong copyleft would reach | ||
| # the whole linked binary. Unlisted licenses are denied. | ||
| # | ||
| # ittapi (GPL-2.0-only) and r-efi (LGPL-2.1-or-later) are dual-licensed and | ||
| # satisfied from an entry below. | ||
| allow = [ | ||
| "Apache-2.0", | ||
| "Apache-2.0 WITH LLVM-exception", | ||
| "BlueOak-1.0.0", | ||
| "BSD-2-Clause", | ||
| "BSD-3-Clause", | ||
| "BlueOak-1.0.0", | ||
| "CC0-1.0", | ||
| "CDLA-Permissive-2.0", | ||
| "ISC", | ||
| "MIT", | ||
| "MPL-2.0", | ||
| "Zlib", | ||
| "Unicode-DFS-2016", | ||
| "Unicode-3.0", | ||
| "OpenSSL", | ||
| "Zlib", | ||
| ] | ||
|
|
||
| unused-allowed-license = "allow" | ||
| # OpenSSL and Unicode-DFS-2016 sat here unused for years; warn on the next drift. | ||
| unused-allowed-license = "warn" | ||
|
|
||
| [bans] | ||
| # ~60 shared crates differ across cargo-generate, wasmtime, ic-agent and reqwest | ||
| # pins we do not control. | ||
| multiple-versions = "allow" | ||
|
|
||
| [sources] | ||
| allow-git = ["https://github.com/dfinity/agent-rs.git"] | ||
| # Everything resolves from crates.io, and a git revision is mutable enough to | ||
| # make a tagged release non-reproducible. cargo-deny only warns by default. | ||
| unknown-registry = "deny" | ||
| unknown-git = "deny" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.