From b36ae0a684d1506868ab3d97d4530857bb2341e0 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Fri, 15 Nov 2024 16:38:13 -0800 Subject: [PATCH] Try new workflow to check files --- .github/workflows/check_diff.yml | 29 +++++++++++++++++++++++++++++ .github/workflows/cuda.yml | 9 ++++++--- 2 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/check_diff.yml diff --git a/.github/workflows/check_diff.yml b/.github/workflows/check_diff.yml new file mode 100644 index 00000000000..8c0dd8ba12d --- /dev/null +++ b/.github/workflows/check_diff.yml @@ -0,0 +1,29 @@ +name: Check changed files + +on: + pull_request: + +concurrency: + group: ${{ github.ref }}-${{ github.head_ref }}-checkdiff + cancel-in-progress: true + +jobs: + check_diff: + runs-on: ubuntu-20.04 + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Get changed files + run: | + git diff --name-only --diff-filter=ACMRTUXB ${GITHUB_BASE_REF}..${GITHUB_HEAD_REF} > check_diff.txt + - name: Check changed files + run: | + if grep -v -E "^(docs|\.github)/" check_diff.txt; then + echo "skip=false" >> ${GITHUB_OUTPUT} + else + echo "skip=true" >> ${GITHUB_OUTPUT} + fi + outputs: + skip: ${{ steps.check.outputs.skip_workflows }} diff --git a/.github/workflows/cuda.yml b/.github/workflows/cuda.yml index 2209f425d1f..e34edee2e2d 100644 --- a/.github/workflows/cuda.yml +++ b/.github/workflows/cuda.yml @@ -5,6 +5,9 @@ on: branches: - "development" pull_request: + workflow_run: + workflows: [Check changed files] + types: [completed] concurrency: group: ${{ github.ref }}-${{ github.head_ref }}-cuda @@ -18,7 +21,7 @@ jobs: build_nvcc: name: NVCC 11.3 SP runs-on: ubuntu-20.04 - if: github.event.pull_request.draft == false + if: ${{ github.event.pull_request.draft == false && github.event.workflow_run.outputs.skip == "false" }} env: CXXFLAGS: "-Werror" CMAKE_GENERATOR: Ninja @@ -110,7 +113,7 @@ jobs: build_nvcc_gnumake: name: NVCC 11.8.0 GNUmake runs-on: ubuntu-20.04 - if: github.event.pull_request.draft == false + if: ${{ github.event.pull_request.draft == false && github.event.workflow_run.outputs.skip == "false" }} steps: - uses: actions/checkout@v4 - name: install dependencies @@ -144,7 +147,7 @@ jobs: build_nvhpc24-1-nvcc: name: NVHPC@24.1 NVCC/NVC++ Release [tests] runs-on: ubuntu-20.04 - if: github.event.pull_request.draft == false + if: ${{ github.event.pull_request.draft == false && github.event.workflow_run.outputs.skip == "false" }} #env: # # For NVHPC, Ninja is slower than the default: # CMAKE_GENERATOR: Ninja