Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Build GMT dev source code with OpenMP enabled on Linux and GThreads enabled on Linux/macOS #3011

Merged
merged 3 commits into from
May 21, 2024
Merged
Changes from 1 commit
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
Next Next commit
CI: Build GMT dev source code with OpenMP enabled on Linux and GThrea…
…ds enabled on Linux/macOS
  • Loading branch information
seisman committed May 21, 2024
commit f7b918f70d9d3db047cd7c77522f17715d3905c1
40 changes: 30 additions & 10 deletions .github/workflows/ci_tests_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -87,18 +86,40 @@ 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
seisman marked this conversation as resolved.
Show resolved Hide resolved
- name: Checkout the GMT source codes in ${{ matrix.gmt_git_ref }} branch
seisman marked this conversation as resolved.
Show resolved Hide resolved
uses: actions/[email protected]
with:
repository: 'GenericMappingTools/gmt'
ref: ${{ matrix.gmt_git_ref }}
path: 'gmt'

- name: Build GMT source codes on Linux/macOS
seisman marked this conversation as resolved.
Show resolved Hide resolved
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
GMT_ENABLE_OPENMP=FALSE
else
GMT_ENABLE_OPENMP=TRUE
fi
cd gmt/
mkdir build
cd build
cmake -G Ninja .. \
-DCMAKE_INSTALL_PREFIX=${{ env.GMT_INSTALL_DIR }} \
-DCMAKE_BUILD_TYPE=Release \
-DGMT_ENABLE_OPENMP=${GMT_ENABLE_OPENMP} \
-DGMT_USE_THREADS=TRUE
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: Install GMT ${{ matrix.gmt_git_ref }} branch (Windows)
- name: Build GMT source codes on Windows
seisman marked this conversation as resolved.
Show resolved Hide resolved
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
Expand All @@ -114,7 +135,6 @@ jobs:
cd ..
rm -rf gmt/
env:
GMT_GIT_REF: ${{ matrix.gmt_git_ref }}
GMT_INSTALL_DIR: ${{ runner.temp }}/gmt-install-dir
if: runner.os == 'Windows'

Expand Down
Loading