From af67396483cff0f84469c0e609bdc71898bcb384 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Mon, 15 Feb 2021 19:40:44 -0500 Subject: [PATCH 1/5] CI: Run tests on Ubuntu + Python 3.9 only for draft PRs This PR makes changes to save CI resources: - For draft PRs: only run tests on Ubuntu + Python 3.9 (~10 minutes) - When draft PRs are ready for review, run all CI jobs (9 jobs, 10-30 minutes) - If converting PRs back to draft mode, pushes still only trigger one job --- .github/workflows/ci_tests.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/ci_tests.yaml b/.github/workflows/ci_tests.yaml index 7e745252b91..2a3073daddf 100644 --- a/.github/workflows/ci_tests.yaml +++ b/.github/workflows/ci_tests.yaml @@ -7,6 +7,7 @@ on: push: branches: [ master ] pull_request: + types: [opened, reopened, synchronize, ready_for_review] paths-ignore: - 'doc/**' - '*.md' @@ -29,6 +30,22 @@ jobs: matrix: python-version: [3.7, 3.8, 3.9] os: [ubuntu-latest, macOS-latest, windows-latest] + # Is a draft PR? + isDraft: + - ${{ github.event.pull_request.draft }} + # Only run one job (Ubuntu + Python 3.9) for draft PRs + exclude: + - os: macOS-latest + isDraft: true + - os: windows-latest + isDraft: true + - os: ubuntu-latest + python-version: 3.7 + isDraft: true + - os: ubuntu-latest + python-version: 3.8 + isDraft: true + # environmental variables used in coverage env: OS: ${{ matrix.os }} From 7c6309d2111bb2779c3b0d948ba8deca8de5ee27 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Mon, 15 Feb 2021 21:29:50 -0500 Subject: [PATCH 2/5] Commit changes in draft PR --- .github/workflows/ci_tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_tests.yaml b/.github/workflows/ci_tests.yaml index 2a3073daddf..e9b9004935d 100644 --- a/.github/workflows/ci_tests.yaml +++ b/.github/workflows/ci_tests.yaml @@ -30,7 +30,7 @@ jobs: matrix: python-version: [3.7, 3.8, 3.9] os: [ubuntu-latest, macOS-latest, windows-latest] - # Is a draft PR? + # Is a draft PR (true|false)? isDraft: - ${{ github.event.pull_request.draft }} # Only run one job (Ubuntu + Python 3.9) for draft PRs From 4dc7e87d1cefe9b0e8d9dfdc25850c91101e6a53 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Mon, 15 Feb 2021 21:50:02 -0500 Subject: [PATCH 3/5] Commit changes to trigger CI jobs in ready-for-review PR --- .github/workflows/ci_tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_tests.yaml b/.github/workflows/ci_tests.yaml index e9b9004935d..1210927f715 100644 --- a/.github/workflows/ci_tests.yaml +++ b/.github/workflows/ci_tests.yaml @@ -30,7 +30,7 @@ jobs: matrix: python-version: [3.7, 3.8, 3.9] os: [ubuntu-latest, macOS-latest, windows-latest] - # Is a draft PR (true|false)? + # Is a draft PR (true or false)? isDraft: - ${{ github.event.pull_request.draft }} # Only run one job (Ubuntu + Python 3.9) for draft PRs From 06d00734386c6809b91704e22c0f1a01db97f95e Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Mon, 15 Feb 2021 22:12:06 -0500 Subject: [PATCH 4/5] Update MAINTENANCE.md --- MAINTENANCE.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTENANCE.md b/MAINTENANCE.md index c6ed5d3477e..ab74f1052e6 100644 --- a/MAINTENANCE.md +++ b/MAINTENANCE.md @@ -58,6 +58,8 @@ It is also scheduled to run daily on the *master* branch. This is ran on every commit to the *master* and Pull Request branches. It is also scheduled to run daily on the *master* branch. +In draft PRs, only one job (Ubuntu + Python latest) is triggered to +save CI resources. On the *master* branch, the workflow also handles the documentation deployment: From d2e41fa983098eb7ed5ca072d390cd7443d2cbf6 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Mon, 15 Feb 2021 23:39:00 -0500 Subject: [PATCH 5/5] Apply suggestions from code review Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com> --- .github/workflows/ci_tests.yaml | 2 +- MAINTENANCE.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_tests.yaml b/.github/workflows/ci_tests.yaml index 1210927f715..427879532c1 100644 --- a/.github/workflows/ci_tests.yaml +++ b/.github/workflows/ci_tests.yaml @@ -30,7 +30,7 @@ jobs: matrix: python-version: [3.7, 3.8, 3.9] os: [ubuntu-latest, macOS-latest, windows-latest] - # Is a draft PR (true or false)? + # Is it a draft Pull Request (true or false)? isDraft: - ${{ github.event.pull_request.draft }} # Only run one job (Ubuntu + Python 3.9) for draft PRs diff --git a/MAINTENANCE.md b/MAINTENANCE.md index ab74f1052e6..ecc9a2c600f 100644 --- a/MAINTENANCE.md +++ b/MAINTENANCE.md @@ -58,8 +58,8 @@ It is also scheduled to run daily on the *master* branch. This is ran on every commit to the *master* and Pull Request branches. It is also scheduled to run daily on the *master* branch. -In draft PRs, only one job (Ubuntu + Python latest) is triggered to -save CI resources. +In draft Pull Requests, only one job (Ubuntu + Python latest) +is triggered to save on Continuous Integration resources. On the *master* branch, the workflow also handles the documentation deployment: