From c3d8ba50b653709bcb9e03420857fa552bdcbb7f Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Tue, 30 Apr 2024 12:30:53 +1200 Subject: [PATCH] ci: Add skip check to other actions --- .github/workflows/test-docs.yml | 15 +++++++++++++++ .github/workflows/test-linux.yml | 16 ++++++++++++++++ .github/workflows/test-macos.yml | 16 ++++++++++++++++ 3 files changed, 47 insertions(+) diff --git a/.github/workflows/test-docs.yml b/.github/workflows/test-docs.yml index 00e5309bfbe..df086375f15 100644 --- a/.github/workflows/test-docs.yml +++ b/.github/workflows/test-docs.yml @@ -6,7 +6,22 @@ on: - main jobs: + pre_job: + runs-on: ubuntu-latest + outputs: + should_skip: ${{ steps.skip_check.outputs.should_skip }} + steps: + - id: skip_check + uses: fkirc/skip-duplicate-actions@v5 + with: + # cancel previous builds if a new commit is pushed + cancel_others: 'true' + # only run on push *or* pull_request, not both + concurrent_skipping: 'same_content_newer' + test-docs: + needs: pre_job + if: needs.pre_job.outputs.should_skip != 'true' runs-on: ubuntu-latest steps: - name: Install Dependencies diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index c4441a8843e..5f18c7b3b9e 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -3,7 +3,23 @@ name: Build and run tests (Linux) on: [push, pull_request] jobs: + pre_job: + runs-on: ubuntu-latest + outputs: + should_skip: ${{ steps.skip_check.outputs.should_skip }} + steps: + - id: skip_check + uses: fkirc/skip-duplicate-actions@v5 + with: + paths_ignore: '["**/README.md", "docs/**", "guidelines/**"]' + # cancel previous builds if a new commit is pushed + cancel_others: 'true' + # only run on push *or* pull_request, not both + concurrent_skipping: 'same_content_newer' + test-linux: + needs: pre_job + if: needs.pre_job.outputs.should_skip != 'true' runs-on: ${{ matrix.os.id }} strategy: matrix: diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 8ca658c3951..baf43f5c867 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -3,7 +3,23 @@ name: Build and run tests (macOS) on: [push, pull_request] jobs: + pre_job: + runs-on: ubuntu-latest + outputs: + should_skip: ${{ steps.skip_check.outputs.should_skip }} + steps: + - id: skip_check + uses: fkirc/skip-duplicate-actions@v5 + with: + paths_ignore: '["**/README.md", "docs/**", "guidelines/**"]' + # cancel previous builds if a new commit is pushed + cancel_others: 'true' + # only run on push *or* pull_request, not both + concurrent_skipping: 'same_content_newer' + test-macos: + needs: pre_job + if: needs.pre_job.outputs.should_skip != 'true' runs-on: ${{ matrix.os.id }} strategy: matrix: