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

CSUB-386: Enable cargo audit in CI #880

Merged
merged 4 commits into from
Mar 20, 2023
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
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,50 @@ jobs:
run: |
./scripts/check-usage-of-log-warn.sh

audit:
name: cargo audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set-Up
run: |
sudo apt-get update
sudo apt install -y protobuf-compiler

- name: Configure rustc version
run: |
source ci/env
echo "RUSTC_VERSION=$RUSTC_VERSION" >> $GITHUB_ENV

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUSTC_VERSION }}
target: wasm32-unknown-unknown
profile: minimal
override: true
- uses: Swatinem/rust-cache@v2

- name: Install cargo audit
run: |
cargo install cargo-audit --features=fix
atodorov marked this conversation as resolved.
Show resolved Hide resolved

- name: Run cargo audit
run: |
cargo audit --ignore RUSTSEC-2020-0071
CC_MATCH=$(cargo audit --ignore RUSTSEC-2020-0071 --color never | egrep "^.── creditcoin" || true)
nathanwhit marked this conversation as resolved.
Show resolved Hide resolved

# fail for anything which is a 1st level dependency of Creditcoin
if [ -n "$CC_MATCH" ]; then
echo "FAIL: Direct dependencies of Creditcoin found in audit report"
echo "INFO: Inspect the output above for more information"
exit 1
else
echo "INFO: No direct dependencies of Creditcoin found in audit report"
exit 0
fi
nathanwhit marked this conversation as resolved.
Show resolved Hide resolved

fmt:
name: Rustfmt
runs-on: ubuntu-latest
Expand Down
Loading