From 4ee86f1a53f682214603ab5bf8bf8bedd63319b7 Mon Sep 17 00:00:00 2001 From: Rina Fujino <18257209+rina23q@users.noreply.github.com> Date: Thu, 21 Jul 2022 11:46:59 +0200 Subject: Run all pull request checks on the changes of workflow files Add a new filter to detect the file changes in .github/workflows dir Signed-off-by: Rina Fujino <18257209+rina23q@users.noreply.github.com> --- .github/workflows/pull-request-checks.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pull-request-checks.yml b/.github/workflows/pull-request-checks.yml index 2064a0d6..327d968c 100644 --- a/.github/workflows/pull-request-checks.yml +++ b/.github/workflows/pull-request-checks.yml @@ -28,6 +28,7 @@ jobs: outputs: docs: ${{ steps.filter.outputs.docs }} rust: ${{ steps.filter.outputs.rust }} + workflows: ${{ steps.filter.outputs.workflows }} steps: # For pull requests it's not necessary to checkout the code - uses: dorny/paths-filter@v2 @@ -40,11 +41,13 @@ jobs: rust: - 'crates/**' - 'plugins/**' + workflows: + - '.github/workflows/**' udeps: name: Check for unused dependencies runs-on: ubuntu-latest - if: ${{ needs.changes.outputs.rust == 'true' }} + if: ${{ needs.changes.outputs.rust == 'true' || needs.changes.outputs.workflows == 'true' }} steps: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 @@ -61,7 +64,7 @@ jobs: name: Run mdbook build runs-on: ubuntu-20.04 needs: changes - if: ${{ needs.changes.outputs.docs == 'true' }} + if: ${{ needs.changes.outputs.docs == 'true' || needs.changes.outputs.workflows == 'true' }} steps: - name: Checkout uses: actions/checkout@v2 @@ -104,7 +107,7 @@ jobs: name: Run cargo fmt runs-on: Ubuntu-20.04 needs: changes - if: ${{ needs.changes.outputs.rust == 'true' }} + if: ${{ needs.changes.outputs.rust == 'true' || needs.changes.outputs.workflows == 'true' }} steps: - name: Checkout @@ -128,7 +131,7 @@ jobs: name: Run cargo clippy runs-on: Ubuntu-20.04 needs: changes - if: ${{ needs.changes.outputs.rust == 'true' }} + if: ${{ needs.changes.outputs.rust == 'true' || needs.changes.outputs.workflows == 'true' }} steps: - name: Checkout @@ -164,7 +167,7 @@ jobs: name: Run cargo audit runs-on: Ubuntu-20.04 needs: changes - if: ${{ needs.changes.outputs.rust == 'true' }} + if: ${{ needs.changes.outputs.rust == 'true' || needs.changes.outputs.workflows == 'true' }} steps: - name: Checkout -- cgit v1.2.3 From f9ea2100d40a1f10eebe0bb2ea93d3ab1ee1026e Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 21 Jul 2022 12:43:09 +0200 Subject: Fix: Also consider rust changed if Cargo.lock changes This patch adds the "Cargo.lock" file to the filters in the github-action setup, so that if dependabot updates a dependency, but only the "Cargo.lock" file got changed, the CI is triggered for a full build. Suggested-by: PradeepKiruvale Signed-off-by: Matthias Beyer Signed-off-by: Rina Fujino <18257209+rina23q@users.noreply.github.com> --- .github/workflows/pull-request-checks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull-request-checks.yml b/.github/workflows/pull-request-checks.yml index 327d968c..32da5125 100644 --- a/.github/workflows/pull-request-checks.yml +++ b/.github/workflows/pull-request-checks.yml @@ -41,6 +41,7 @@ jobs: rust: - 'crates/**' - 'plugins/**' + - 'Cargo.*' workflows: - '.github/workflows/**' -- cgit v1.2.3