Merge pull request #370 from donnaaboise/remove-snippets-dir #961
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
name: CI for CMake | |
on: | |
push: | |
paths-ignore: | |
- '.github/workflows/*.yml' | |
- '!.github/workflows/ci_cmake.yml' | |
pull_request: | |
release: | |
types: [published] | |
env: | |
CMAKE_BUILD_PARALLEL_LEVEL: 4 | |
CTEST_NO_TESTS_ACTION: "error" | |
CMAKE_INSTALL_PREFIX: ~/local | |
CMAKE_PREFIX_PATH: ~/local | |
jobs: | |
linux: | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 60 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- name: "Serial Minimal" | |
configure_flags: "" | |
ubuntu_packages: "" | |
- name: "Serial With Clawpack" | |
configure_flags: "-Dclawpack=ON" | |
ubuntu_packages: "" | |
- name: "Serial With Clawpack and HDF" | |
configure_flags: "-Dclawpack=ON -Dhdf5=ON" | |
ubuntu_packages: "" | |
- name: "Serial With GeoClaw" | |
configure_flags: "-Dgeoclaw=ON" | |
ubuntu_packages: "" | |
- name: "Serial With CudaClaw (CUDA 10.1)" | |
configure_flags: "-Dcudaclaw=ON" | |
ubuntu_packages: "nvidia-cuda-toolkit" | |
cuda: true | |
- name: "Serial With CudaClaw (CUDA 11.3)" | |
configure_flags: "-Dcudaclaw=ON" | |
configure_environment: "CUDACXX=/usr/local/cuda/bin/nvcc" | |
ubuntu_packages: "" | |
cuda: true | |
cuda_11_3: true | |
- name: "MPI Minimal" | |
configure_flags: "-Dmpi=ON" | |
ubuntu_packages: "libopenmpi-dev openmpi-bin" | |
- name: "MPI With Clawpack" | |
configure_flags: "-Dmpi=ON -Dclawpack=ON" | |
ubuntu_packages: "libopenmpi-dev openmpi-bin" | |
- name: "MPI With Clawpack and HDF" | |
configure_flags: "-Dmpi=ON -Dclawpack=ON -Dhdf5=ON" | |
ubuntu_packages: "libopenmpi-dev openmpi-bin" | |
- name: "MPI With GeoClaw" | |
configure_flags: "-Dmpi=ON -Dgeoclaw=ON" | |
ubuntu_packages: "libopenmpi-dev openmpi-bin" | |
- name: "MPI With CudaClaw (CUDA 10.1)" | |
configure_flags: "-Dmpi=ON -Dcudaclaw=ON" | |
ubuntu_packages: "libopenmpi-dev openmpi-bin nvidia-cuda-toolkit" | |
cuda: true | |
- name: "MPI With CudaClaw (CUDA 11.3)" | |
configure_flags: "-Dmpi=ON -Dcudaclaw=ON" | |
configure_environment: "CUDACXX=/usr/local/cuda/bin/nvcc" | |
ubuntu_packages: "libopenmpi-dev openmpi-bin" | |
cuda: true | |
cuda_11_3: true | |
- name: "MPI With ThunderEgg" | |
configure_flags: "-Dmpi=ON -Dthunderegg=ON" | |
ubuntu_packages: "libopenmpi-dev openmpi-bin libfftw3-dev" | |
name: CMake ${{ matrix.name }} Build on Linux | |
steps: | |
- uses: actions/checkout@v4 | |
name: Checkout source code | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update -yq | |
sudo apt-get install -yq --no-install-recommends \ | |
${{ matrix.ubuntu_packages }} | |
- name: Install Cuda Toolkit 11.3 | |
if: ${{ matrix.cuda_11_3 }} | |
run: | | |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb | |
sudo dpkg -i cuda-keyring_1.0-1_all.deb | |
sudo apt-get update | |
sudo apt-get -y install cuda-toolkit-11-3 | |
- name: CMake configure | |
run: ${{ matrix.configure_environment }} cmake --preset ci ${{ matrix.configure_flags }} | |
- name: CMake build | |
run: cmake --build --preset ci | |
- name: CMake test | |
if: ${{ !matrix.cuda }} | |
run: ctest --preset default | |
- name: CMake install (for examples) | |
run: cmake --install build | |
- name: CMake configure examples | |
run: ${{ matrix.configure_environment }} cmake -B applications/build -S applications --preset ci | |
- name: CMake build examples | |
run: cmake --build applications/build | |
- name: Create package | |
if: github.event.action == 'published' | |
run: cpack --config build/CPackConfig.cmake | |
- name: Upload package | |
if: github.event.action == 'published' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: binary-archive | |
path: build/package | |
mac: | |
runs-on: macos-14 | |
name: CMake build on MacOS | |
env: | |
HOMEBREW_NO_INSTALL_CLEANUP: 1 | |
CC: gcc-14 | |
CXX: g++-14 | |
FC: gfortran-14 | |
steps: | |
- uses: actions/checkout@v4 | |
name: Checkout source code | |
- name: Install system dependencies | |
run: brew install open-mpi ninja fftw | |
- name: CMake configure | |
run: cmake --preset mac -Dclawpack=on -Dgeoclaw=on -Dthunderegg=on | |
- name: CMake build | |
run: cmake --build --preset default | |
- name: CMake test | |
run: ctest --preset default | |
- name: CMake install (for examples) | |
run: cmake --install build | |
- name: CMake configure examples | |
run: cmake -B applications/build -S applications | |
- name: CMake build examples | |
run: cmake --build applications/build | |
- name: Create package | |
if: github.event.action == 'published' | |
run: cpack --config build/CPackConfig.cmake | |
- name: Upload package | |
if: github.event.action == 'published' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: binary-archive | |
path: build/package |