From f205babf1ca912157e725b2eb9af2c70a9fd335a Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Tue, 22 Oct 2024 16:46:15 -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 | 48 +++++++++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 5f1278333..691ee04ce 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-checks @@ -28,6 +29,38 @@ jobs: - devcontainer 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' + - '!CONTRIBUTING.md' + - '!README.md' + - '!docs/**' + - '!java/**' + - '!notebooks/**' + - '!python/**' + # TODO: Remove this before merging + - '!.github/workflows/**' + test_notebooks: + - '**' + - '!.pre-commit-config.yaml' + - '!CONTRIBUTING.md' + - '!README.md' + test_python: + - '**' + - '!.pre-commit-config.yaml' + - '!CONTRIBUTING.md' + - '!README.md' + - '!docs/**' + - '!java/**' + - '!notebooks/**' checks: secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@branch-24.12 @@ -47,9 +80,10 @@ jobs: build_type: pull-request enable_check_symbols: true 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: @@ -59,15 +93,17 @@ 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_cpp with: build_type: pull-request conda-notebook-tests: - needs: conda-python-build + needs: [conda-python-build, changed-files] secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.12 + if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_notebooks with: build_type: pull-request node_type: "gpu-v100-latest-1" @@ -101,9 +137,10 @@ jobs: build_type: pull-request script: ci/build_wheel_cuspatial.sh wheel-tests-cuspatial: - needs: wheel-build-cuspatial + needs: [wheel-build-cuspatial, 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_cuspatial.sh @@ -115,9 +152,10 @@ jobs: build_type: pull-request script: ci/build_wheel_cuproj.sh wheel-tests-cuproj: - needs: [wheel-build-cuspatial, wheel-build-cuproj] + needs: [wheel-build-cuspatial, wheel-build-cuproj, 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_cuproj.sh From 68e86b0c385ab8649768eca532c26a99dbebe185 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Tue, 22 Oct 2024 17:04:33 -0400 Subject: [PATCH 2/3] Remove temporary exclusion of .github/workflows --- .github/workflows/pr.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 691ee04ce..2188b9883 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -46,8 +46,6 @@ jobs: - '!java/**' - '!notebooks/**' - '!python/**' - # TODO: Remove this before merging - - '!.github/workflows/**' test_notebooks: - '**' - '!.pre-commit-config.yaml' From 84476a954d8909a885553e7db19705cc70b184fd Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Tue, 22 Oct 2024 17:33:18 -0400 Subject: [PATCH 3/3] Exclude .devcontainer --- .github/workflows/pr.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 2188b9883..3f6a68b8a 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -39,6 +39,7 @@ jobs: files_yaml: | test_cpp: - '**' + - '!.devcontainer/**' - '!.pre-commit-config.yaml' - '!CONTRIBUTING.md' - '!README.md' @@ -48,11 +49,13 @@ jobs: - '!python/**' test_notebooks: - '**' + - '!.devcontainer/**' - '!.pre-commit-config.yaml' - '!CONTRIBUTING.md' - '!README.md' test_python: - '**' + - '!.devcontainer/**' - '!.pre-commit-config.yaml' - '!CONTRIBUTING.md' - '!README.md'