From 11446e2b13ae503f6eeb1a9c0a5bee43262434a7 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Mon, 1 Feb 2021 00:23:56 -0500 Subject: [PATCH 1/6] Add slash command '/test-gmt-master' to test GMT master branch --- .github/workflows/ci_tests_dev.yaml | 32 ++++++++++++++++++++ .github/workflows/slash-command-dispatch.yml | 1 + 2 files changed, 33 insertions(+) diff --git a/.github/workflows/ci_tests_dev.yaml b/.github/workflows/ci_tests_dev.yaml index 92a407749e1..b954f77e07c 100644 --- a/.github/workflows/ci_tests_dev.yaml +++ b/.github/workflows/ci_tests_dev.yaml @@ -8,6 +8,8 @@ on: # branches: [ master ] pull_request: types: [review_requested, ready_for_review] + repository_dispatch: + types: [test-gmt-master-command] # Schedule daily tests schedule: - cron: '0 0 * * *' @@ -36,10 +38,31 @@ jobs: # Checkout current git repository - name: Checkout uses: actions/checkout@v2.3.4 + if: github.event_name != 'repository_dispatch' with: # fecth all history so that setuptools-scm works fetch-depth: 0 + # Generate token from GenericMappingTools bot + - name: Generate token from GenericMappingTools bot + uses: tibdex/github-app-token@v1 + if: github.event_name == 'repository_dispatch' + id: generate-token + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.APP_PRIVATE_KEY }} + + # Checkout the pull request branch + - name: Checkout + uses: actions/checkout@v2 + if: github.event_name == 'repository_dispatch' + with: + token: ${{ steps.generate-token.outputs.token }} + repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }} + ref: ${{ github.event.client_payload.pull_request.head.ref }} + # fecth all history so that setuptools-scm works + fetch-depth: 0 + # Setup Miniconda - name: Setup Miniconda uses: conda-incubator/setup-miniconda@v2.0.0 @@ -106,3 +129,12 @@ jobs: with: name: artifact-GMT-${{ matrix.gmt_git_ref }}-${{ runner.os }} path: tmp-test-dir-with-unique-name + + - name: Add reaction + uses: peter-evans/create-or-update-comment@v1 + if: github.event_name == 'repository_dispatch' + with: + token: ${{ steps.generate-token.outputs.token }} + repository: ${{ github.event.client_payload.github.payload.repository.full_name }} + comment-id: ${{ github.event.client_payload.github.payload.comment.id }} + reaction-type: hooray diff --git a/.github/workflows/slash-command-dispatch.yml b/.github/workflows/slash-command-dispatch.yml index 84ad9d400d2..ccc3395457d 100644 --- a/.github/workflows/slash-command-dispatch.yml +++ b/.github/workflows/slash-command-dispatch.yml @@ -21,5 +21,6 @@ jobs: token: ${{ steps.generate-token.outputs.token }} commands: | format + test-gmt-master issue-type: pull-request permission: none From 4a22c59aa2b3e04b4f018c13c1b5dc8d4e28dae9 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Mon, 1 Feb 2021 12:58:42 -0500 Subject: [PATCH 2/6] Remove 'review_requested' from the triggering condition --- .github/workflows/ci_tests_dev.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_tests_dev.yaml b/.github/workflows/ci_tests_dev.yaml index b954f77e07c..6bdf05c0e54 100644 --- a/.github/workflows/ci_tests_dev.yaml +++ b/.github/workflows/ci_tests_dev.yaml @@ -7,7 +7,7 @@ on: # push: # branches: [ master ] pull_request: - types: [review_requested, ready_for_review] + types: [ready_for_review] repository_dispatch: types: [test-gmt-master-command] # Schedule daily tests From 8620bab3fe1c00d9c0ff1e89b403b3a2a3e5f26b Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Mon, 1 Feb 2021 13:02:22 -0500 Subject: [PATCH 3/6] Update pull request template --- .github/PULL_REQUEST_TEMPLATE.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 2a5392b2b68..5de45287aae 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -16,6 +16,10 @@ Fixes # - [ ] Write detailed docstrings for all functions/methods. - [ ] If adding new functionality, add an example to docstrings or tutorials. -**Notes** +**Slash Commands** -- You can write `/format` in the first line of a comment to lint the code automatically +You can write slash commands (`/command`) in the first line of a comment to perform +specific operations. Supported slash commands are: + +- `/format`: format and lint the codes automatically +- `/test-gmt-master`: run the full tests with the GMT latest codes From ef31c150dabb74fa83f22aff7a0aae9dc2c40da6 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Mon, 1 Feb 2021 13:05:14 -0500 Subject: [PATCH 4/6] Update maintenance guide --- MAINTENANCE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MAINTENANCE.md b/MAINTENANCE.md index af80e4bc82c..67511ac1935 100644 --- a/MAINTENANCE.md +++ b/MAINTENANCE.md @@ -62,8 +62,8 @@ On the *master* branch, the workflow also handles the documentation deployment: 2. `ci_tests_dev.yaml` (GMT Latest Tests on Linux/macOS/Windows). -This is only triggered when a review is requested or re-requested on a PR. -It is also scheduled to run daily on the *master* branch. +This is triggered when a PR is marked as "ready for review", or using the slash +command `/test-gmt-master`. It is also scheduled to run daily on the *master* branch. 3. `cache_data.yaml` (Caches GMT remote data files needed for GitHub Actions CI) From 6df8e340cc9462efec6365ccdbe9f8c644da3fea Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Mon, 1 Feb 2021 18:36:00 -0500 Subject: [PATCH 5/6] Apply suggestions from code review Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com> Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com> --- .github/PULL_REQUEST_TEMPLATE.md | 4 ++-- .github/workflows/ci_tests_dev.yaml | 2 +- .github/workflows/slash-command-dispatch.yml | 2 +- MAINTENANCE.md | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 5de45287aae..8e3982647e5 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -21,5 +21,5 @@ Fixes # You can write slash commands (`/command`) in the first line of a comment to perform specific operations. Supported slash commands are: -- `/format`: format and lint the codes automatically -- `/test-gmt-master`: run the full tests with the GMT latest codes +- `/format`: automatically format and lint the code +- `/test-gmt-dev`: run full tests on the latest GMT development version diff --git a/.github/workflows/ci_tests_dev.yaml b/.github/workflows/ci_tests_dev.yaml index 6bdf05c0e54..d9c89feb909 100644 --- a/.github/workflows/ci_tests_dev.yaml +++ b/.github/workflows/ci_tests_dev.yaml @@ -9,7 +9,7 @@ on: pull_request: types: [ready_for_review] repository_dispatch: - types: [test-gmt-master-command] + types: [test-gmt-dev-command] # Schedule daily tests schedule: - cron: '0 0 * * *' diff --git a/.github/workflows/slash-command-dispatch.yml b/.github/workflows/slash-command-dispatch.yml index ccc3395457d..918597888e1 100644 --- a/.github/workflows/slash-command-dispatch.yml +++ b/.github/workflows/slash-command-dispatch.yml @@ -21,6 +21,6 @@ jobs: token: ${{ steps.generate-token.outputs.token }} commands: | format - test-gmt-master + test-gmt-dev issue-type: pull-request permission: none diff --git a/MAINTENANCE.md b/MAINTENANCE.md index 67511ac1935..c86b963e7c1 100644 --- a/MAINTENANCE.md +++ b/MAINTENANCE.md @@ -63,7 +63,7 @@ On the *master* branch, the workflow also handles the documentation deployment: 2. `ci_tests_dev.yaml` (GMT Latest Tests on Linux/macOS/Windows). This is triggered when a PR is marked as "ready for review", or using the slash -command `/test-gmt-master`. It is also scheduled to run daily on the *master* branch. +command `/test-gmt-dev`. It is also scheduled to run daily on the *master* branch. 3. `cache_data.yaml` (Caches GMT remote data files needed for GitHub Actions CI) From 72b7dfae6207e1461ae4a51295efbe1c2d1722ef Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Mon, 1 Feb 2021 18:39:43 -0500 Subject: [PATCH 6/6] Rename workflow to 'GMT Dev Tests' --- .github/workflows/ci_tests_dev.yaml | 4 ++-- MAINTENANCE.md | 2 +- README.rst | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci_tests_dev.yaml b/.github/workflows/ci_tests_dev.yaml index d9c89feb909..1bae79758ab 100644 --- a/.github/workflows/ci_tests_dev.yaml +++ b/.github/workflows/ci_tests_dev.yaml @@ -1,7 +1,7 @@ -# This workflow installs PyGMT dependencies, builds documentation and runs tests on GMT latest +# This workflow installs PyGMT dependencies, builds documentation and runs tests on GMT dev version # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions -name: GMT Latest Tests +name: GMT Dev Tests on: # push: diff --git a/MAINTENANCE.md b/MAINTENANCE.md index c86b963e7c1..07c8f04b853 100644 --- a/MAINTENANCE.md +++ b/MAINTENANCE.md @@ -60,7 +60,7 @@ On the *master* branch, the workflow also handles the documentation deployment: *master* branch onto the `dev` folder of the *gh-pages* branch. * Updated the `latest` documentation link to the new release. -2. `ci_tests_dev.yaml` (GMT Latest Tests on Linux/macOS/Windows). +2. `ci_tests_dev.yaml` (GMT Dev Tests on Linux/macOS/Windows). This is triggered when a PR is marked as "ready for review", or using the slash command `/test-gmt-dev`. It is also scheduled to run daily on the *master* branch. diff --git a/README.rst b/README.rst index 592c93facc6..c0a54d5153b 100644 --- a/README.rst +++ b/README.rst @@ -13,8 +13,8 @@ PyGMT .. image:: https://github.com/GenericMappingTools/pygmt/workflows/Tests/badge.svg :alt: GitHub Actions Tests status :target: https://github.com/GenericMappingTools/pygmt/actions?query=workflow%3ATests -.. image:: https://github.com/GenericMappingTools/pygmt/workflows/GMT%20Latest%20Tests/badge.svg - :alt: GitHub Actions GMT Latest Tests status +.. image:: https://github.com/GenericMappingTools/pygmt/workflows/GMT%20Dev%20Tests/badge.svg + :alt: GitHub Actions GMT Dev Tests status :target: https://github.com/GenericMappingTools/pygmt/actions?query=workflow%3A%22GMT+Latest+Tests%22 .. image:: https://img.shields.io/codecov/c/github/GenericMappingTools/pygmt/master.svg?style=flat-square :alt: Test coverage status