Skip to content

Commit 213a414

Browse files
seismanweiji14
andauthored
Add slash command '/test-gmt-dev' to test GMT dev version (#831)
* Add slash command '/test-gmt-dev' to test GMT dev version * Remove 'review_requested' from the triggering condition * Update pull request template * Update maintenance guide * Rename workflow to 'GMT Dev Tests' Co-authored-by: Wei Ji <[email protected]>
1 parent 153355e commit 213a414

File tree

5 files changed

+47
-10
lines changed

5 files changed

+47
-10
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ Fixes #
1616
- [ ] Write detailed docstrings for all functions/methods.
1717
- [ ] If adding new functionality, add an example to docstrings or tutorials.
1818

19-
**Notes**
19+
**Slash Commands**
2020

21-
- You can write `/format` in the first line of a comment to lint the code automatically
21+
You can write slash commands (`/command`) in the first line of a comment to perform
22+
specific operations. Supported slash commands are:
23+
24+
- `/format`: automatically format and lint the code
25+
- `/test-gmt-dev`: run full tests on the latest GMT development version

.github/workflows/ci_tests_dev.yaml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
# This workflow installs PyGMT dependencies, builds documentation and runs tests on GMT latest
1+
# This workflow installs PyGMT dependencies, builds documentation and runs tests on GMT dev version
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
33

4-
name: GMT Latest Tests
4+
name: GMT Dev Tests
55

66
on:
77
# push:
88
# branches: [ master ]
99
pull_request:
10-
types: [review_requested, ready_for_review]
10+
types: [ready_for_review]
11+
repository_dispatch:
12+
types: [test-gmt-dev-command]
1113
# Schedule daily tests
1214
schedule:
1315
- cron: '0 0 * * *'
@@ -36,10 +38,31 @@ jobs:
3638
# Checkout current git repository
3739
- name: Checkout
3840
uses: actions/[email protected]
41+
if: github.event_name != 'repository_dispatch'
3942
with:
4043
# fecth all history so that setuptools-scm works
4144
fetch-depth: 0
4245

46+
# Generate token from GenericMappingTools bot
47+
- name: Generate token from GenericMappingTools bot
48+
uses: tibdex/github-app-token@v1
49+
if: github.event_name == 'repository_dispatch'
50+
id: generate-token
51+
with:
52+
app_id: ${{ secrets.APP_ID }}
53+
private_key: ${{ secrets.APP_PRIVATE_KEY }}
54+
55+
# Checkout the pull request branch
56+
- name: Checkout
57+
uses: actions/checkout@v2
58+
if: github.event_name == 'repository_dispatch'
59+
with:
60+
token: ${{ steps.generate-token.outputs.token }}
61+
repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}
62+
ref: ${{ github.event.client_payload.pull_request.head.ref }}
63+
# fecth all history so that setuptools-scm works
64+
fetch-depth: 0
65+
4366
# Setup Miniconda
4467
- name: Setup Miniconda
4568
uses: conda-incubator/[email protected]
@@ -106,3 +129,12 @@ jobs:
106129
with:
107130
name: artifact-GMT-${{ matrix.gmt_git_ref }}-${{ runner.os }}
108131
path: tmp-test-dir-with-unique-name
132+
133+
- name: Add reaction
134+
uses: peter-evans/create-or-update-comment@v1
135+
if: github.event_name == 'repository_dispatch'
136+
with:
137+
token: ${{ steps.generate-token.outputs.token }}
138+
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
139+
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
140+
reaction-type: hooray

.github/workflows/slash-command-dispatch.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ jobs:
2121
token: ${{ steps.generate-token.outputs.token }}
2222
commands: |
2323
format
24+
test-gmt-dev
2425
issue-type: pull-request
2526
permission: none

MAINTENANCE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ On the *master* branch, the workflow also handles the documentation deployment:
6060
*master* branch onto the `dev` folder of the *gh-pages* branch.
6161
* Updated the `latest` documentation link to the new release.
6262

63-
2. `ci_tests_dev.yaml` (GMT Latest Tests on Linux/macOS/Windows).
63+
2. `ci_tests_dev.yaml` (GMT Dev Tests on Linux/macOS/Windows).
6464

65-
This is only triggered when a review is requested or re-requested on a PR.
66-
It is also scheduled to run daily on the *master* branch.
65+
This is triggered when a PR is marked as "ready for review", or using the slash
66+
command `/test-gmt-dev`. It is also scheduled to run daily on the *master* branch.
6767

6868
3. `cache_data.yaml` (Caches GMT remote data files needed for GitHub Actions CI)
6969

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ PyGMT
1313
.. image:: https://github.com/GenericMappingTools/pygmt/workflows/Tests/badge.svg
1414
:alt: GitHub Actions Tests status
1515
:target: https://github.com/GenericMappingTools/pygmt/actions?query=workflow%3ATests
16-
.. image:: https://github.com/GenericMappingTools/pygmt/workflows/GMT%20Latest%20Tests/badge.svg
17-
:alt: GitHub Actions GMT Latest Tests status
16+
.. image:: https://github.com/GenericMappingTools/pygmt/workflows/GMT%20Dev%20Tests/badge.svg
17+
:alt: GitHub Actions GMT Dev Tests status
1818
:target: https://github.com/GenericMappingTools/pygmt/actions?query=workflow%3A%22GMT+Latest+Tests%22
1919
.. image:: https://img.shields.io/codecov/c/github/GenericMappingTools/pygmt/master.svg?style=flat-square
2020
:alt: Test coverage status

0 commit comments

Comments
 (0)