From 98f2de7a8e9b5ffa29a2087a64466c65b461f9ca Mon Sep 17 00:00:00 2001 From: Bart Louwers Date: Tue, 19 Sep 2023 11:49:46 +0200 Subject: [PATCH] Skip `linux-ci` when not needed (#1656) --- .github/workflows/linux-ci.yml | 52 +++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/.github/workflows/linux-ci.yml b/.github/workflows/linux-ci.yml index 700700b0b..2d8c1c045 100644 --- a/.github/workflows/linux-ci.yml +++ b/.github/workflows/linux-ci.yml @@ -5,20 +5,6 @@ on: push: branches: - main - paths: - - "src/**" - - "test/**" - - "render-test/**" - - "expression-test/**" - - "include/**" - - ".github/workflows/linux-ci.yml" - - "vendor/**" - - "CMakeLists.txt" - - metrics/linux-gcc8-release-style.json - - WORKSPACE - - BUILD.bazel - - .bazelrc - - .bazelversion pull_request: branches: @@ -30,6 +16,29 @@ concurrency: cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} jobs: + pre_job: + runs-on: ubuntu-22.04 + outputs: + should_skip: ${{ steps.skip_check.outputs.should_skip }} + steps: + - id: skip_check + uses: fkirc/skip-duplicate-actions@v5 + with: + paths: | + ["src/**", + "test/**", + "render-test/**", + "expression-test/**", + "include/**", + ".github/workflows/linux-ci.yml", + "vendor/**", + "CMakeLists.txt", + "metrics/linux-gcc8-release-style.json", + "WORKSPACE", + "BUILD.bazel", + ".bazelrc", + ".bazelversion"] + linux-build: strategy: fail-fast: false @@ -225,3 +234,18 @@ jobs: files: ${{ env.coverage_report }} fail_ci_if_error: true verbose: true + + linux-ci-result: + name: Linux CI Result + if: needs.pre_job.outputs.should_skip != 'true' && always() + runs-on: ubuntu-22.04 + needs: + - pre_job + - linux-build + - linux-test + - linux-render-test + - linux-coverage + steps: + - name: Mark result as failed + if: needs.linux-build.result != 'success' || needs.linux-test.result != 'success' || needs.linux-render-test.result != 'success' || needs.linux-coverage.result != 'success' + run: exit 1 \ No newline at end of file