Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

permissions: {}

jobs:
benchmarks:
runs-on: ubuntu-latest
Expand All @@ -38,6 +40,7 @@ jobs:
with:
# fetch all history so that setuptools-scm works
fetch-depth: 0
persist-credentials: false

- name: Get current week number of year
id: date
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/cache_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ on:
schedule:
- cron: '0 12 * * 0'

permissions: {}

jobs:
gmt_cache:
name: Cache GMT artifacts
Expand All @@ -40,6 +42,7 @@ jobs:
with:
# fetch all history so that setuptools-scm works
fetch-depth: 0
persist-credentials: false

# Install Micromamba with conda-forge dependencies
- name: Setup Micromamba
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ on:
schedule:
- cron: '0 12 * * 0'

permissions: {}

jobs:
check_links:
name: Check Links
Expand All @@ -26,12 +28,14 @@ jobs:
uses: actions/[email protected]
with:
path: repository
persist-credentials: false

- name: Checkout the documentation
uses: actions/[email protected]
with:
ref: gh-pages
path: documentation
persist-credentials: false

- name: Link Checker
id: lychee
Expand Down Expand Up @@ -72,7 +76,8 @@ jobs:
if: env.lychee_exit_code != 0
run: |
cd repository/
title="Link Checker Report on ${{ steps.date.outputs.date }}"
title="Link Checker Report on ${CURRENT_DATE}"
gh issue create --title "$title" --body-file /tmp/lychee-out.md
env:
GH_TOKEN: ${{ github.token }}
CURRENT_DATE: ${{ steps.date.outputs.date }}
7 changes: 6 additions & 1 deletion .github/workflows/ci_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

permissions: {}

jobs:
docs:
name: ${{ matrix.os }}
Expand Down Expand Up @@ -73,6 +75,7 @@ jobs:
with:
# fetch all history so that setuptools-scm works
fetch-depth: 0
persist-credentials: false

- name: Get current week number of year
id: date
Expand Down Expand Up @@ -159,10 +162,11 @@ jobs:
if: github.event_name == 'push' && matrix.os == 'ubuntu-latest'

- name: Upload the HTML ZIP archive and PDF as release assets
run: gh release upload ${{ github.ref_name }} doc/_build/pygmt-docs.zip doc/_build/pygmt-docs.pdf
run: gh release upload ${REF_NAME} doc/_build/pygmt-docs.zip doc/_build/pygmt-docs.pdf
if: github.event_name == 'release' && matrix.os == 'ubuntu-latest'
env:
GH_TOKEN: ${{ github.token }}
REF_NAME: ${{ github.ref_name }}

- name: Checkout the gh-pages branch
uses: actions/[email protected]
Expand All @@ -172,6 +176,7 @@ jobs:
path: deploy
# Download the entire history
fetch-depth: 0
persist-credentials: false
if: (github.event_name == 'release' || github.event_name == 'push') && (matrix.os == 'ubuntu-latest')

- name: Push the built HTML to gh-pages
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci_doctests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

permissions: {}

jobs:
test:
name: ${{ matrix.os }}
Expand All @@ -39,6 +41,7 @@ jobs:
with:
# fetch all history so that setuptools-scm works
fetch-depth: 0
persist-credentials: false

# Install Micromamba with conda-forge dependencies
- name: Setup Micromamba
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ jobs:
with:
# fetch all history so that setuptools-scm works
fetch-depth: 0
persist-credentials: false

- name: Get current week number of year
id: date
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/ci_tests_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

permissions: {}

jobs:
test_gmt_dev:
name: ${{ matrix.os }} - GMT ${{ matrix.gmt_git_ref }}
Expand All @@ -50,6 +52,7 @@ jobs:
with:
# fetch all history so that setuptools-scm works
fetch-depth: 0
persist-credentials: false

- name: Get current week number of year
id: date
Expand Down Expand Up @@ -96,6 +99,7 @@ jobs:
repository: 'GenericMappingTools/gmt'
ref: ${{ matrix.gmt_git_ref }}
path: 'gmt'
persist-credentials: false

# Build GMT from source on Linux/macOS, script is adapted from
# https://github.com/GenericMappingTools/gmt/blob/6.5.0/ci/build-gmt.sh
Expand All @@ -105,7 +109,7 @@ jobs:
mkdir build
cd build
cmake -G Ninja .. \
-DCMAKE_INSTALL_PREFIX=${{ env.GMT_INSTALL_DIR }} \
-DCMAKE_INSTALL_PREFIX=${GMT_INSTALL_DIR} \
-DCMAKE_BUILD_TYPE=Release \
-DGMT_ENABLE_OPENMP=TRUE \
-DGMT_USE_THREADS=TRUE
Expand All @@ -125,7 +129,7 @@ jobs:
cd build
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cmake -G Ninja .. ^
-DCMAKE_INSTALL_PREFIX=${{ env.GMT_INSTALL_DIR }} ^
-DCMAKE_INSTALL_PREFIX=${env:GMT_INSTALL_DIR} ^
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Windows CI is failing, maybe try the one below (xref: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#using-the-env-context-to-access-environment-variable-values):

Suggested change
-DCMAKE_INSTALL_PREFIX=${env:GMT_INSTALL_DIR} ^
-DCMAKE_INSTALL_PREFIX=$env:GMT_INSTALL_DIR ^

Copy link
Member Author

@weiji14 weiji14 Mar 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think it's because of the path? It looks set to GMT_INSTALL_DIR: D:\a\_temp/gmt-install-dir with or without the curly braces, same as at https://github.com/GenericMappingTools/pygmt/actions/runs/13889360104/job/38858639159#step:8:21

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Owh, looks like the Cmake build on Windows didn't complete - https://github.com/GenericMappingTools/pygmt/actions/runs/13934908307/job/39000590987#step:8:669

[0/1] Install the project...
CMake Warning (dev) at cmake_install.cmake:5 (set):
  Syntax error in cmake code at

    D:/a/pygmt/pygmt/gmt/build/cmake_install.cmake:5

  when parsing string

    D:/a/pygmt/pygmt/gmt/build/${env:GMT_INSTALL_DIR}

  syntax error, unexpected cal_SYMBOL, expecting } (30)

  Policy CMP0010 is not set: Bad variable reference syntax is an error.  Run
  "cmake --help-policy CMP0010" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Install configuration: "Release"
CMake Error at src/cmake_install.cmake:36 (file):
  file cannot create directory:
  D:/a/pygmt/pygmt/gmt/build/${env:GMT_INSTALL_DIR}/lib.  Maybe need
  administrative privileges.
Call Stack (most recent call first):
  cmake_install.cmake:37 (include)


FAILED: CMakeFiles/install.util 
C:\Windows\system32\cmd.exe /C "cd /D D:\a\pygmt\pygmt\gmt\build && "C:\Program Files\CMake\bin\cmake.exe" -P cmake_install.cmake"
ninja: build stopped: subcommand failed.

Copy link
Member Author

@weiji14 weiji14 Mar 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, looking at https://github.com/GenericMappingTools/pygmt/actions/runs/13934908307/job/39000590987#step:8:435, there are these lines:

*  Locations:
*  Installing GMT in          : D:/a/pygmt/pygmt/gmt/build/${env:GMT_INSTALL_DIR}
*  GMT_DATADIR                : D:/a/pygmt/pygmt/gmt/build/${env:GMT_INSTALL_DIR}/share
*  GMT_DOCDIR                 : D:/a/pygmt/pygmt/gmt/build/${env:GMT_INSTALL_DIR}/share/doc
*  GMT_MANDIR                 : D:/a/pygmt/pygmt/gmt/build/${env:GMT_INSTALL_DIR}/share/man

So the environment variable replacement isn't working on powershell Edit: wait, we're not using powershell, it seems to be just regular Windows cmd.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_PREFIX_PATH=${{ env.MAMBA_ROOT_PREFIX }}\envs\pygmt\Library ^
-DGMT_ENABLE_OPENMP=TRUE ^
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci_tests_legacy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

permissions: {}

jobs:
test:
name: ${{ matrix.os }} - GMT ${{ matrix.gmt_version }}
Expand All @@ -48,6 +50,7 @@ jobs:
with:
# fetch all history so that setuptools-scm works
fetch-depth: 0
persist-credentials: false

# Install Micromamba with conda-forge dependencies
- name: Setup Micromamba
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/dvc-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ on:
paths:
- 'pygmt/tests/baseline/*.png.dvc'

permissions: {}

jobs:
dvc-diff:
name: DVC image diff
Expand All @@ -25,6 +27,7 @@ jobs:
with:
# fetch all history so that dvc diff works
fetch-depth: 0
persist-credentials: false

- name: Setup data version control (DVC)
uses: iterative/[email protected]
Expand Down Expand Up @@ -53,6 +56,7 @@ jobs:
- name: Generate the image diff report
env:
repo_token: ${{ github.token }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
echo -e "## Summary of changed images\n" > report.md
echo -e "This is an auto-generated report of images that have changed on the DVC remote\n" >> report.md
Expand Down Expand Up @@ -94,7 +98,7 @@ jobs:
echo -e "</details>\n" >> report.md

# Mention git commit SHA in the report
echo -e "Report last updated at commit ${{ github.event.pull_request.head.sha }}" >> report.md
echo -e "Report last updated at commit ${PR_HEAD_SHA}" >> report.md

# create/update PR comment
cml comment update report.md
5 changes: 5 additions & 0 deletions .github/workflows/format-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
# This workflow is triggered in a PR if the slash command `/format` is used.
#
name: format-command

on:
repository_dispatch:
types: [format-command]

permissions: {}

jobs:
format:
runs-on: ubuntu-latest
Expand All @@ -23,6 +27,7 @@ jobs:
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 }}
persist-credentials: false

# Setup Python environment
- uses: actions/[email protected]
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ on:
# branches:
# - main

permissions: {}

jobs:
build:
name: Build distribution 📦
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/release-baseline-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
steps:
- name: Checkout
uses: actions/[email protected]
with:
persist-credentials: false

- name: Setup data version control (DVC)
uses: iterative/[email protected]
Expand All @@ -39,6 +41,7 @@ jobs:
shasum -a 256 baseline-images.zip

- name: Upload baseline image as a release asset
run: gh release upload ${{ github.ref_name }} baseline-images.zip
run: gh release upload ${REF_NAME} baseline-images.zip
env:
GH_TOKEN: ${{ github.token }}
REF_NAME: ${{ github.ref_name }}
2 changes: 2 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ on:
branches:
- main

permissions: {}

jobs:
update_release_draft:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/slash-command-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
# Currently, only one slash command `format` is supported.
#
name: Slash Command Dispatch

on:
issue_comment:
types: [created]
# Add "edited" type for test purposes. Where possible, avoid using to prevent processing unnecessary events.
# types: [created, edited]

permissions: {}

jobs:
slashCommandDispatch:
if: ${{ github.event.issue.pull_request }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/style_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ on:
schedule:
- cron: '0 0 * * *'

permissions: {}

jobs:
style_check:
name: Style Checks
Expand All @@ -25,6 +27,8 @@ jobs:
# Checkout current git repository
- name: Checkout
uses: actions/[email protected]
with:
persist-credentials: false

# Setup Python
- name: Set up Python
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/type_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

permissions: {}

jobs:
static_check:
name: Static Type Check
Expand All @@ -34,6 +36,8 @@ jobs:
# Checkout current git repository
- name: Checkout
uses: actions/[email protected]
with:
persist-credentials: false

# Setup Python
- name: Set up Python
Expand Down
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ repos:
- id: remove-crlf
- id: chmod
args: ['644']
- repo: https://github.com/woodruffw/zizmor-pre-commit
rev: v1.5.1
hooks:
- id: zizmor


# https://pre-commit.ci/#configuration
ci:
Expand Down
Loading