From 0e818c20cfad38d4c880ba3d8c35d85900fea22e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C5=A1a=20Tomi=C4=87?= Date: Fri, 6 Sep 2024 10:23:51 +0200 Subject: [PATCH] chore(ci): Use the same cargo-deny-checks.sh script locally and on the CI (#878) --- .github/workflows/build/action.yaml | 2 +- bin/cargo-deny-checks.sh | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build/action.yaml b/.github/workflows/build/action.yaml index ff64c364c..e58f7a3d3 100644 --- a/.github/workflows/build/action.yaml +++ b/.github/workflows/build/action.yaml @@ -17,7 +17,7 @@ runs: echo Installing cargo-deny >&2 cargo install --quiet cargo-deny } - cargo deny check -D warnings + bin/cargo-deny-checks.sh shell: bash - name: "Build and repin" diff --git a/bin/cargo-deny-checks.sh b/bin/cargo-deny-checks.sh index 1046ebe4c..dfe2603e8 100755 --- a/bin/cargo-deny-checks.sh +++ b/bin/cargo-deny-checks.sh @@ -1,4 +1,13 @@ #!/usr/bin/env bash +command -v cargo >/dev/null || { + if test -x "$HOME/.cargo/bin/cargo"; then + export PATH="$HOME/.cargo/bin:$PATH" + else + echo "'cargo' not found. Please install it by following the instructions at https://doc.rust-lang.org/cargo/getting-started/installation.html" + exit 1 + fi +} + command -v cargo-deny >/dev/null || echo "'cargo-deny' not found. Please install it by running 'cargo install cargo-deny'" cargo deny check