-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Building GMT dev source codes with OpenMP support on Linux
- Loading branch information
Showing
1 changed file
with
44 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,8 @@ | |
# installed by fetching the latest source codes from the GMT master branch and | ||
# compiling. | ||
# | ||
# It is triggered when a pull request is marked as "ready as review", or labeled with | ||
# 'run/test-gmt-dev'. It is also scheduled to run on Monday, Wednesday, and Friday on | ||
# the main branch. | ||
# It is triggered in a pull request if labeled with 'run/test-gmt-dev'. | ||
# It is also scheduled to run on Monday, Wednesday, and Friday on the main branch. | ||
# | ||
name: GMT Dev Tests | ||
|
||
|
@@ -81,35 +80,61 @@ jobs: | |
pcre | ||
zlib | ||
# Build and install latest GMT from GitHub | ||
- name: Install GMT ${{ matrix.gmt_git_ref }} branch (Linux/macOS) | ||
run: curl https://raw.githubusercontent.com/GenericMappingTools/gmt/master/ci/build-gmt.sh | bash | ||
# Checkout current the GMT source codes | ||
- name: Checkout the GMT source codes in ${{ matrix.gmt_git_ref }} branch | ||
uses: actions/[email protected] | ||
with: | ||
repository: 'GenericMappingTools/gmt' | ||
ref: ${{ matrix.gmt_git_ref }} | ||
path: 'gmt' | ||
|
||
- name: Configure GMT | ||
run: | | ||
cd gmt/ | ||
if [ "${RUNNER_OS}" == "macOS" ]; then # Can't make macOS support OpenMP now | ||
ENABLE_OPENMP=FALSE | ||
ENABLE_THREADS=FALSE | ||
else | ||
ENABLE_OPENMP=TRUE | ||
ENABLE_THREADS=TRUE | ||
fi | ||
cat >> cmake/ConfigUser.cmake << EOF | ||
set (CMAKE_INSTALL_PREFIX ${{ env.GMT_INSTALL_DIR }}) | ||
set (CMAKE_BUILD_TYPE Release) | ||
set (GMT_ENABLE_OPENMP ${ENABLE_OPENMP}) | ||
set (GMT_USE_THREADS ${ENABLE_THREADS}) | ||
EOF | ||
if [ "${RUNNER_OS}" == "Windows" ]; then | ||
echo "set (CMAKE_PREFIX_PATH ${{ env.MAMBA_ROOT_PREFIX }}\envs\pygmt\Library)" >> cmake/ConfigUser.cmake | ||
fi | ||
cat cmake/ConfigUser.cmake | ||
env: | ||
GMT_GIT_REF: ${{ matrix.gmt_git_ref }} | ||
GMT_INSTALL_DIR: ${{ runner.temp }}/gmt-install-dir | ||
|
||
- name: Build GMT source codes on Linux/macOS | ||
run: | | ||
cd gmt/ | ||
mkdir build | ||
cd build | ||
cmake -G Ninja .. | ||
cmake --build . | ||
cmake --build . --target install | ||
cd .. | ||
rm -rf gmt/ | ||
if: runner.os != 'Windows' | ||
|
||
- name: Install GMT ${{ matrix.gmt_git_ref }} branch (Windows) | ||
- name: Build GMT source codes on Windows | ||
shell: cmd | ||
run: | | ||
git clone --depth=1 --single-branch --branch ${{ env.GMT_GIT_REF }} https://github.com/GenericMappingTools/gmt | ||
cd gmt/ | ||
mkdir build | ||
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_BUILD_TYPE=Release ^ | ||
-DCMAKE_PREFIX_PATH=${{ env.MAMBA_ROOT_PREFIX }}\envs\pygmt\Library ^ | ||
-DGMT_ENABLE_OPENMP=TRUE ^ | ||
-DGMT_USE_THREADS=TRUE | ||
cmake -G Ninja .. | ||
cmake --build . | ||
cmake --build . --target install | ||
cd .. | ||
rm -rf gmt/ | ||
env: | ||
GMT_GIT_REF: ${{ matrix.gmt_git_ref }} | ||
GMT_INSTALL_DIR: ${{ runner.temp }}/gmt-install-dir | ||
if: runner.os == 'Windows' | ||
|
||
- name: Add GMT's bin to PATH | ||
|
@@ -122,7 +147,7 @@ jobs: | |
--extra-index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple \ | ||
'numpy<2' pandas xarray netCDF4 packaging \ | ||
build contextily dvc geopandas ipython pyarrow rioxarray \ | ||
'pytest>=6.0' pytest-cov pytest-doctestplus pytest-mpl \ | ||
pytest pytest-cov pytest-doctestplus pytest-mpl \ | ||
sphinx-gallery | ||
# Show installed pkg information for postmortem diagnostic | ||
|