From 26b302dda6c4f9fc9670fe268181db495246d5f1 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Fri, 4 Oct 2024 15:53:39 -0400 Subject: [PATCH 1/3] Prune workflows based on changed files Contributes to https://github.com/rapidsai/build-planning/issues/94 --- .github/workflows/pr.yaml | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index f1d9f224e..b65c15cb2 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -12,6 +12,7 @@ concurrency: jobs: pr-builder: needs: + - changed-files - checks - conda-cpp-build - conda-cpp-tests @@ -22,6 +23,27 @@ jobs: - wheel-test-pylibwholegraph secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@branch-24.12 + if: always() + with: + needs: ${{ toJSON(needs) }} + changed-files: + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/changed-files.yaml@branch-24.12 + with: + files_yaml: | + test_cpp: + - '**' + - '!.pre-commit-config.yaml' + - '!README.md' + - '!python/**' + # TODO: Remove this before merging + - '!.github/workflows/**' + test_python: + - '**' + - '!.pre-commit-config.yaml' + - '!README.md' + # TODO: Remove this before merging + - '!.github/workflows/**' checks: secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@branch-24.12 @@ -35,9 +57,10 @@ jobs: build_type: pull-request node_type: cpu16 conda-cpp-tests: - needs: conda-cpp-build + needs: [conda-cpp-build, changed-files] secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-tests.yaml@branch-24.12 + if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_cpp with: build_type: pull-request conda-python-build: @@ -47,9 +70,10 @@ jobs: with: build_type: pull-request conda-python-tests: - needs: conda-python-build + needs: [conda-python-build, changed-files] secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.12 + if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python with: build_type: pull-request docs-build: @@ -69,9 +93,10 @@ jobs: build_type: pull-request script: ci/build_wheel.sh wheel-test-pylibwholegraph: - needs: wheel-build-pylibwholegraph + needs: [wheel-build-pylibwholegraph, changed-files] secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.12 + if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python with: build_type: pull-request script: ci/test_wheel.sh From 0473b279f390724e667ca2e652aa47c4a48c7896 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Fri, 4 Oct 2024 15:59:57 -0400 Subject: [PATCH 2/3] Exclude scripts/checks --- .github/workflows/pr.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index b65c15cb2..871056e40 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -36,12 +36,14 @@ jobs: - '!.pre-commit-config.yaml' - '!README.md' - '!python/**' + - '!scripts/checks/**' # TODO: Remove this before merging - '!.github/workflows/**' test_python: - '**' - '!.pre-commit-config.yaml' - '!README.md' + - '!scripts/checks/**' # TODO: Remove this before merging - '!.github/workflows/**' checks: From e91023acf4c9a04651362ac06770d4e45917bfbd Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Fri, 4 Oct 2024 16:00:14 -0400 Subject: [PATCH 3/3] Remove temporary exclusion of .github/workflows --- .github/workflows/pr.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 871056e40..9dad6369c 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -37,15 +37,11 @@ jobs: - '!README.md' - '!python/**' - '!scripts/checks/**' - # TODO: Remove this before merging - - '!.github/workflows/**' test_python: - '**' - '!.pre-commit-config.yaml' - '!README.md' - '!scripts/checks/**' - # TODO: Remove this before merging - - '!.github/workflows/**' checks: secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@branch-24.12