Skip to content

Commit af7892f

Browse files
authored
CI: Run "GMT Dev Tests" if PR is labeled with 'run/test-gmt-dev' (#2960)
1 parent ecefd53 commit af7892f

File tree

3 files changed

+12
-36
lines changed

3 files changed

+12
-36
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ Fixes #
2121
**Slash Commands**
2222

2323
You can write slash commands (`/command`) in the first line of a comment to perform
24-
specific operations. Supported slash commands are:
24+
specific operations. Supported slash command is:
2525

2626
- `/format`: automatically format and lint the code
27-
- `/test-gmt-dev`: run full tests on the latest GMT development version

.github/workflows/ci_tests_dev.yaml

Lines changed: 10 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
11
# Test PyGMT with GMT dev version on Linux/macOS/Windows
22
#
3-
# This workflow runs regular PyGMT tests with the GMT dev version, and also
4-
# pre-release versions of several dependencies like NumPy, Pandas, Xarray, etc.
5-
# If any tests fail, it also uploads the diff images as workflow artifacts.
6-
# The GMT dev version is installed by fetching the latest source codes from
7-
# the GMT master branch and compiling.
3+
# This workflow runs regular PyGMT tests with the GMT dev version, and also pre-release
4+
# versions of several dependencies like NumPy, Pandas, Xarray, etc. If any tests fail,
5+
# it also uploads the diff images as workflow artifacts. The GMT dev version is
6+
# installed by fetching the latest source codes from the GMT master branch and
7+
# compiling.
88
#
9-
# It is triggered when a pull request is marked as "ready as review", or using
10-
# the slash command `/test-gmt-dev`. It is also scheduled to run on Monday,
11-
# Wednesday, and Friday on the main branch.
9+
# It is triggered when a pull request is marked as "ready as review", or labeled with
10+
# 'run/test-gmt-dev'. It is also scheduled to run on Monday, Wednesday, and Friday on
11+
# the main branch.
1212
#
1313
name: GMT Dev Tests
1414

1515
on:
1616
# push:
1717
# branches: [ main ]
1818
pull_request:
19-
types: [ready_for_review]
19+
types: [ opened, reopened, labeled, synchronize ]
2020
paths:
2121
- 'pygmt/**'
2222
- '.github/workflows/ci_tests_dev.yaml'
23-
repository_dispatch:
24-
types: [test-gmt-dev-command]
2523
# Schedule tests on Monday/Wednesday/Friday
2624
schedule:
2725
- cron: '0 0 * * 1,3,5'
@@ -34,6 +32,7 @@ jobs:
3432
test_gmt_dev:
3533
name: ${{ matrix.os }} - GMT ${{ matrix.gmt_git_ref }}
3634
runs-on: ${{ matrix.os }}
35+
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run/test-gmt-dev')
3736
strategy:
3837
fail-fast: false
3938
matrix:
@@ -48,31 +47,10 @@ jobs:
4847
# Checkout current git repository
4948
- name: Checkout
5049
uses: actions/[email protected]
51-
if: github.event_name != 'repository_dispatch'
5250
with:
5351
# fetch all history so that setuptools-scm works
5452
fetch-depth: 0
5553

56-
# Checkout the pull request branch
57-
- name: Checkout
58-
uses: actions/[email protected]
59-
if: github.event_name == 'repository_dispatch'
60-
with:
61-
token: ${{ secrets.GITHUB_TOKEN }}
62-
repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}
63-
ref: ${{ github.event.client_payload.pull_request.head.ref }}
64-
# fetch all history so that setuptools-scm works
65-
fetch-depth: 0
66-
67-
- name: Show job URL
68-
uses: peter-evans/[email protected]
69-
if: github.event_name == 'repository_dispatch' && runner.os == 'Linux'
70-
with:
71-
token: ${{ secrets.GITHUB_TOKEN }}
72-
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
73-
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
74-
body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
75-
7654
# Install Micromamba with conda-forge dependencies
7755
- name: Setup Micromamba
7856
uses: mamba-org/[email protected]

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Support slash commands in pull requests
22
#
3-
# Currently, two slash commands `format` and `test-gmt-dev` are supported.
3+
# Currently, only one slash command `format` is supported.
44
#
55
name: Slash Command Dispatch
66
on:
@@ -19,6 +19,5 @@ jobs:
1919
token: ${{ secrets.GITHUB_TOKEN }}
2020
commands: |
2121
format
22-
test-gmt-dev
2322
issue-type: pull-request
2423
permission: none

0 commit comments

Comments
 (0)