From 27ff5324739b445e26fa19f698f2a8ccc2038ca5 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Wed, 14 May 2025 15:21:08 +0100 Subject: [PATCH] ci: Explicitly specify workflow dependencies (#2110) --- .github/workflows/build.yml | 18 ++++++++++++++++++ .github/workflows/clang-tidy.yml | 9 +++++---- .github/workflows/nightly.yml | 11 +++++++++-- .github/workflows/sanitizers.yml | 16 +++++++++++++++- .github/workflows/update_docker_ci.yml | 12 ++++++++---- 5 files changed, 55 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 278d3d1d..a2613999 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,6 +5,24 @@ on: branches: [master, release/*, develop] pull_request: branches: [master, release/*, develop] + paths: + - .github/workflows/build.yml + + - .github/workflows/build_and_test.yml + - .github/workflows/build_impl.yml + - .github/workflows/test_impl.yml + - .github/workflows/upload_coverage_report.yml + + - ".github/actions/**" + - "!.github/actions/build_docker_image/**" + - "!.github/actions/create_issue/**" + + - CMakeLists.txt + - "cmake/**" + - "src/**" + - "tests/**" + + - docs/config-description.md workflow_dispatch: concurrency: diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index ad6e925a..00646dbe 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -7,9 +7,10 @@ on: pull_request: branches: [develop] paths: - - .clang_tidy - .github/workflows/clang-tidy.yml + - .clang_tidy + concurrency: # Only cancel in-progress jobs or runs for the current workflow - matches against branch & tags group: ${{ github.workflow }}-${{ github.ref }} @@ -86,7 +87,7 @@ jobs: rm output.txt - name: Create an issue - if: ${{ steps.run_clang_tidy.outcome != 'success' }} + if: ${{ steps.run_clang_tidy.outcome != 'success' && github.event_name != 'pull_request' }} id: create_issue uses: ./.github/actions/create_issue env: @@ -99,7 +100,7 @@ jobs: List of the issues found: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/ - uses: crazy-max/ghaction-import-gpg@e89d40939c28e39f97cf32126055eeae86ba74ec # v6.3.0 - if: ${{ steps.run_clang_tidy.outcome != 'success' }} + if: ${{ steps.run_clang_tidy.outcome != 'success' && github.event_name != 'pull_request' }} with: gpg_private_key: ${{ secrets.ACTIONS_GPG_PRIVATE_KEY }} passphrase: ${{ secrets.ACTIONS_GPG_PASSPHRASE }} @@ -107,7 +108,7 @@ jobs: git_commit_gpgsign: true - name: Create PR with fixes - if: ${{ steps.run_clang_tidy.outcome != 'success' }} + if: ${{ steps.run_clang_tidy.outcome != 'success' && github.event_name != 'pull_request' }} uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8 env: GH_REPO: ${{ github.repository }} diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index d64d2574..387b8352 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -6,8 +6,15 @@ on: workflow_dispatch: pull_request: paths: - - ".github/workflows/nightly.yml" - - ".github/workflows/build_clio_docker_image.yml" + - .github/workflows/nightly.yml + + - .github/workflows/release_impl.yml + - .github/workflows/build_and_test.yml + - .github/workflows/build_impl.yml + - .github/workflows/build_clio_docker_image.yml + + - ".github/actions/**" + - "!.github/actions/code_coverage/**" concurrency: # Only cancel in-progress jobs or runs for the current workflow - matches against branch & tags diff --git a/.github/workflows/sanitizers.yml b/.github/workflows/sanitizers.yml index 7733da98..b878968c 100644 --- a/.github/workflows/sanitizers.yml +++ b/.github/workflows/sanitizers.yml @@ -6,7 +6,21 @@ on: workflow_dispatch: pull_request: paths: - - ".github/workflows/sanitizers.yml" + - .github/workflows/sanitizers.yml + + - .github/workflows/build_and_test.yml + - .github/workflows/build_impl.yml + - .github/workflows/test_impl.yml + + - ".github/actions/**" + - "!.github/actions/build_docker_image/**" + - "!.github/actions/create_issue/**" + + - CMakeLists.txt + - "cmake/**" + # We don't run sanitizer on code change, because it takes too long + # - "src/**" + # - "tests/**" concurrency: # Only cancel in-progress jobs or runs for the current workflow - matches against branch & tags diff --git a/.github/workflows/update_docker_ci.yml b/.github/workflows/update_docker_ci.yml index af7d7557..1050b141 100644 --- a/.github/workflows/update_docker_ci.yml +++ b/.github/workflows/update_docker_ci.yml @@ -3,19 +3,23 @@ name: Update CI docker image on: pull_request: paths: + - .github/workflows/update_docker_ci.yml + + - ".github/actions/build_docker_image/**" + - "docker/ci/**" - "docker/compilers/**" - - .github/workflows/update_docker_ci.yml - - ".github/actions/build_docker_image/**" push: branches: [develop] paths: + - .github/workflows/update_docker_ci.yml + + - ".github/actions/build_docker_image/**" + # CI image must update when either its Dockerfile changes # or any compilers changed and were pushed by hand - "docker/ci/**" - "docker/compilers/**" - - .github/workflows/update_docker_ci.yml - - ".github/actions/build_docker_image/**" workflow_dispatch: concurrency: