diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 2a5392b2b68..8e3982647e5 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`: 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 92a407749e1..1bae79758ab 100644 --- a/.github/workflows/ci_tests_dev.yaml +++ b/.github/workflows/ci_tests_dev.yaml @@ -1,13 +1,15 @@ -# 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: # branches: [ master ] pull_request: - types: [review_requested, ready_for_review] + types: [ready_for_review] + repository_dispatch: + types: [test-gmt-dev-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..918597888e1 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-dev issue-type: pull-request permission: none diff --git a/MAINTENANCE.md b/MAINTENANCE.md index af80e4bc82c..07c8f04b853 100644 --- a/MAINTENANCE.md +++ b/MAINTENANCE.md @@ -60,10 +60,10 @@ 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 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-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) 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