From a63f6fc17d050ebfeb9820807a62ac29128448d0 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Fri, 22 Mar 2024 08:43:18 +0800 Subject: [PATCH 1/2] CI: Configure workflows to run on 'workflow_dispatch' event --- .github/workflows/cache_data.yaml | 17 +++++++++++------ .github/workflows/check-links.yml | 1 + .github/workflows/ci_docs.yml | 1 + .github/workflows/ci_doctests.yaml | 1 + .github/workflows/ci_tests.yaml | 1 + .github/workflows/ci_tests_dev.yaml | 1 + .github/workflows/ci_tests_legacy.yaml | 1 + 7 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cache_data.yaml b/.github/workflows/cache_data.yaml index 239fb703bed..49bedd47e7a 100644 --- a/.github/workflows/cache_data.yaml +++ b/.github/workflows/cache_data.yaml @@ -1,12 +1,16 @@ # Cache GMT remote data files and upload as artifacts # -# This workflow downloads data files needed by PyGMT tests/documentation from -# the GMT data server and uploads as workflow artifacts which can be accessed -# by other GitHub Actions workflows. +# This workflow downloads data files needed by PyGMT tests/documentation from the GMT +# data server and uploads as workflow artifacts which can be accessed by other GitHub +# Actions workflows. # -# It is scheduled to run every Sunday at 12:00 (UTC). If new remote files are -# needed urgently, maintainers can update the workflow file or the -# 'pygmt/helpers/caching.py' file to refresh the cache. +# It is scheduled to run every Sunday at 12:00 (UTC). If new remote files are needed +# urgently, maintainers can refresh the cache by either ways: +# +# 1. Update this workflow file +# 2. Update the `pygmt/helpers/caching.py` file +# 3. Go to https://github.com/GenericMappingTools/pygmt/actions/workflows/cache_data.yaml +# and click the "Run workflow" button # name: Cache data @@ -16,6 +20,7 @@ on: paths: - 'pygmt/helpers/caching.py' - '.github/workflows/cache_data.yaml' + workflow_dispatch: # Schedule runs on 12 noon every Sunday schedule: - cron: '0 12 * * 0' diff --git a/.github/workflows/check-links.yml b/.github/workflows/check-links.yml index d6bfc339d32..7afc0aac564 100644 --- a/.github/workflows/check-links.yml +++ b/.github/workflows/check-links.yml @@ -10,6 +10,7 @@ name: Check Links on: # Uncomment the 'pull_request' line below to trigger the workflow in PR # pull_request: + workflow_dispatch: # Schedule runs on 12 noon every Sunday schedule: - cron: '0 12 * * 0' diff --git a/.github/workflows/ci_docs.yml b/.github/workflows/ci_docs.yml index 40258c943f8..ac5f33d96d5 100644 --- a/.github/workflows/ci_docs.yml +++ b/.github/workflows/ci_docs.yml @@ -34,6 +34,7 @@ on: - 'examples/**' - 'README.md' - '.github/workflows/ci_docs.yml' + workflow_dispatch: release: types: - published diff --git a/.github/workflows/ci_doctests.yaml b/.github/workflows/ci_doctests.yaml index a53f7eb5c1d..9524a81f950 100644 --- a/.github/workflows/ci_doctests.yaml +++ b/.github/workflows/ci_doctests.yaml @@ -9,6 +9,7 @@ on: # push: # branches: [ main ] # pull_request: + workflow_dispatch: # Schedule weekly tests on Sunday schedule: - cron: '0 0 * * 0' diff --git a/.github/workflows/ci_tests.yaml b/.github/workflows/ci_tests.yaml index 0690372aa69..8b9ec793063 100644 --- a/.github/workflows/ci_tests.yaml +++ b/.github/workflows/ci_tests.yaml @@ -33,6 +33,7 @@ on: paths: - 'pygmt/**' - '.github/workflows/ci_tests.yaml' + workflow_dispatch: release: types: - published diff --git a/.github/workflows/ci_tests_dev.yaml b/.github/workflows/ci_tests_dev.yaml index 644a149a2c2..18aa30f3c86 100644 --- a/.github/workflows/ci_tests_dev.yaml +++ b/.github/workflows/ci_tests_dev.yaml @@ -20,6 +20,7 @@ on: paths: - 'pygmt/**' - '.github/workflows/ci_tests_dev.yaml' + workflow_dispatch: # Schedule tests on Monday/Wednesday/Friday schedule: - cron: '0 0 * * 1,3,5' diff --git a/.github/workflows/ci_tests_legacy.yaml b/.github/workflows/ci_tests_legacy.yaml index d971923b8dd..fee0e29ec8b 100644 --- a/.github/workflows/ci_tests_legacy.yaml +++ b/.github/workflows/ci_tests_legacy.yaml @@ -17,6 +17,7 @@ on: # paths: # - 'pygmt/**' # - '.github/workflows/ci_tests_legacy.yaml' + workflow_dispatch: # Schedule tests on Tuesday schedule: - cron: '0 0 * * 2' From af7660c79987044fa9eb68795e9b12aadc0864ea Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Fri, 22 Mar 2024 17:27:23 +0800 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com> --- .github/workflows/cache_data.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cache_data.yaml b/.github/workflows/cache_data.yaml index 49bedd47e7a..c2a3ef28abe 100644 --- a/.github/workflows/cache_data.yaml +++ b/.github/workflows/cache_data.yaml @@ -1,11 +1,11 @@ # Cache GMT remote data files and upload as artifacts # # This workflow downloads data files needed by PyGMT tests/documentation from the GMT -# data server and uploads as workflow artifacts which can be accessed by other GitHub -# Actions workflows. +# data server and uploads them as workflow artifacts, which can then be accessed by other +# GitHub Actions workflows. # # It is scheduled to run every Sunday at 12:00 (UTC). If new remote files are needed -# urgently, maintainers can refresh the cache by either ways: +# urgently, maintainers can refresh the cache by one of the following methods: # # 1. Update this workflow file # 2. Update the `pygmt/helpers/caching.py` file