From 2c57fd57ceb42fb6b7e40b4477a2e99f7605a2b3 Mon Sep 17 00:00:00 2001 From: Boshen Date: Fri, 29 Nov 2024 16:39:11 +0800 Subject: [PATCH] ci: separate workflow for cargo deny (save a queueing job) (#7541) --- .github/workflows/ci.yml | 22 ---------------------- .github/workflows/deny.yml | 31 +++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/deny.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6772082f73a70..a71dfc25a2046 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -153,28 +153,6 @@ jobs: with: files: . - deny: - name: Cargo Deny - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - src: - - 'Cargo.lock' - - - uses: Boshen/setup-rust@main - if: steps.filter.outputs.src == 'true' - with: - restore-cache: false - tools: cargo-deny - - - if: steps.filter.outputs.src == 'true' - run: cargo deny check - lint: name: Clippy runs-on: ubuntu-latest diff --git a/.github/workflows/deny.yml b/.github/workflows/deny.yml new file mode 100644 index 0000000000000..d0448fb95f9a0 --- /dev/null +++ b/.github/workflows/deny.yml @@ -0,0 +1,31 @@ +name: Cargo Deny + +on: + workflow_dispatch: + pull_request: + types: [opened, synchronize] + paths: + - "Cargo.lock" + push: + branches: + - main + paths: + - "Cargo.lock" + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: ${{ github.ref_name != 'main' }} + +jobs: + deny: + name: Cargo Deny + runs-on: ubuntu-latest + steps: + - uses: taiki-e/checkout-action@v1 + + - uses: Boshen/setup-rust@main + with: + restore-cache: false + tools: cargo-deny + + - run: cargo deny check