Test #90
This file contains 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
name: Dependencies | |
on: | |
pull_request: | |
paths: | |
- "**/Cargo.toml" | |
- "deny.toml" | |
push: | |
paths: | |
- "**/Cargo.toml" | |
- "deny.toml" | |
branches: | |
- main | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
check-advisories: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- 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: dtolnay/rust-toolchain@stable | |
- name: Install cargo-deny | |
run: cargo install cargo-deny | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.base_ref }} | |
- name: Cargo update (base) | |
run: cargo update | |
- name: Check for banned and duplicated dependencies (base) | |
run: | | |
set -o history | |
OUT_FILE=/tmp/deny-bans-base | |
cargo deny --format json check bans 2>&1 | jq -r -n '[inputs][] | select(.fields.severity != null) | "\(.fields.severity) \(.fields.message)"' | sort > $OUT_FILE | |
fc -ln -1 > /tmp/deny-check-command | |
- uses: actions/checkout@v4 | |
- name: Cargo update (PR) | |
run: cargo update | |
- name: Check for banned and duplicated dependencies (PR) | |
run: | | |
#!/bin/bash | |
OUT_FILE=/tmp/deny-bans-pr | |
cat /tmp/deny-check-command | eval && fail=1 || fail=0 | |
if [[ $fail = "1" ]]; then | |
# show the diff with the entire output. if there's no diff, display the output. | |
diff -U99999 /tmp/deny-bans-pr /tmp/deny-bans-base && cat /tmp/deny-bans-pr | |
exit 1 | |
fi | |
check-licenses: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- 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@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: Install cargo-deny | |
run: cargo install cargo-deny | |
- name: Checked for unauthorized crate sources | |
run: cargo deny check sources |