Skip to content

Commit

Permalink
Merge branch 'develop' into cmake-build-examples-flag
Browse files Browse the repository at this point in the history
  • Loading branch information
dutkalex authored Sep 27, 2024
2 parents 39739ce + 74397d3 commit f8b7691
Show file tree
Hide file tree
Showing 30 changed files with 3,242 additions and 355 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- "CMake*"
- ".github/workflows/ci_cmake.yml"
- ".github/workflows/ci_darwin.yml"
- ".github/workflows/composite-cmake/**"
pull_request:

jobs:
Expand All @@ -26,7 +27,7 @@ jobs:
zlib1g-dev libmpich-dev mpich
- name: Checkout source code
uses: actions/checkout@v3
uses: actions/checkout@main

- name: Run bootstrap script
run: ./bootstrap
Expand Down Expand Up @@ -87,7 +88,7 @@ jobs:
- name: Upload log files
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@main
with:
name: linux_multi_log
path: |
Expand All @@ -107,7 +108,7 @@ jobs:
zlib1g-dev libmpich-dev mpich valgrind
- name: Checkout source code
uses: actions/checkout@v3
uses: actions/checkout@main

- name: Run bootstrap script
run: ./bootstrap
Expand All @@ -124,7 +125,7 @@ jobs:
- name: Upload log files
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@main
with:
name: linux_valgrind_log
path: |
Expand All @@ -144,7 +145,7 @@ jobs:
zlib1g-dev libmpich-dev mpich
- name: Checkout source code
uses: actions/checkout@v3
uses: actions/checkout@main
with:
fetch-depth: 0

Expand All @@ -171,14 +172,14 @@ jobs:
mv libsc-*.tar.gz ..
- name: Upload tarball
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@main
with:
name: libsc_tarball
path: ./libsc-*.tar.gz

- name: Upload log files
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@main
with:
name: linux_tarball_log
path: |
Expand Down
162 changes: 56 additions & 106 deletions .github/workflows/ci_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,29 @@ on:

env:
CTEST_NO_TESTS_ACTION: "error"
CMAKE_BUILD_PARALLEL_LEVEL: 4
CTEST_PARALLEL_LEVEL: 0
CMAKE_INSTALL_PREFIX: ~/local
CMAKE_PREFIX_PATH: ~/local

jobs:

linux:
runs-on: ubuntu-22.04
name: CMake build on Linux
ubuntu-24:
runs-on: ubuntu-24.04
name: Linux mpi=${{ matrix.mpi }} CC=${{ matrix.cc }} shared=${{ matrix.shared }}
timeout-minutes: 60

strategy:
matrix:
cc: [gcc-9, gcc-10, gcc-11, gcc-12, gcc-13]
cc: [gcc, clang]
shared: [false]
mpi: [true]
mpi: [true, false]
# we only include one "shared=true" as it's less common usage
# but we want to be sure CMake is OK with it
include:
- shared: true
cc: gcc
- cc: gcc
shared: true
mpi: true
- cc: clang-14
mpi: false
shared: false
- cc: clang-15
mpi: false
shared: false
# Clang is ABI-incompatible with the libmpich on the CI Ubuntu images.

env:
CC: ${{ matrix.cc }}
Expand All @@ -55,67 +54,48 @@ jobs:
sudo apt-get install --no-install-recommends \
libmpich-dev mpich
- name: CMake configure
run: >-
cmake --preset default
-Dmpi:BOOL=${{ matrix.mpi }}
--install-prefix=${{ runner.temp }}
-DBUILD_SHARED_LIBS:BOOL=${{ matrix.shared }}
- name: CMake print debug find
if: failure()
run: >-
cmake --preset default
-Dmpi:BOOL=${{ matrix.mpi }}
--install-prefix=${{ runner.temp }}
-DBUILD_SHARED_LIBS:BOOL=${{ matrix.shared }}
--debug-find --fresh
- name: CMake composite steps (build, test, install, examples)
uses: ./.github/workflows/composite-cmake

- name: CMake build
run: cmake --build --preset default --parallel

- name: CMake Test
run: ctest --preset default
ubuntu-22:
runs-on: ubuntu-22.04
name: Linux mpi=${{ matrix.mpi }} CC=${{ matrix.cc }} shared=${{ matrix.shared }}
timeout-minutes: 60

- name: CMake install (for examples)
run: cmake --install build
strategy:
matrix:
cc: [gcc]
shared: [false]
mpi: [true]

- name: CMake configure examples
run: cmake -B example/build -S example -DCMAKE_PREFIX_PATH:PATH=${{ runner.temp }}
env:
CC: ${{ matrix.cc }}

- name: CMake build examples
run: cmake --build example/build --parallel
steps:
- uses: actions/checkout@v4
name: Checkout source code

- name: Create package
if: github.event.action == 'published'
run: cpack --config build/CPackConfig.cmake
- name: Install system dependencies
if: ${{ matrix.mpi }}
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends \
libmpich-dev mpich
- name: Upload package
if: github.event.action == 'published'
uses: actions/upload-artifact@v4
with:
name: linux-binary-archive-${{ matrix.cc }}-${{ matrix.mpi }}-shared-${{ matrix.shared }}
path: build/package
- name: CMake composite steps (build, test, install, examples)
uses: ./.github/workflows/composite-cmake

- name: Upload log files
if: always()
uses: actions/upload-artifact@v4
with:
name: linux_cmake_log-${{ matrix.cc }}-${{ matrix.mpi }}-shared-${{ matrix.shared }}
path: |
./build/CMakeFiles/CMakeConfigureLog.yaml
./build/Testing/Temporary/LastTest.log

linux-valgrind:
needs: linux
runs-on: ubuntu-22.04
name: CMake with Valgrind
needs: ubuntu-24
runs-on: ubuntu-24.04
name: Valgrind Linux mpi=${{ matrix.mpi }} CC=${{ matrix.cc }}
timeout-minutes: 60

strategy:
matrix:
cc: [gcc]
shared: [false]
mpi: [true]
valgrind: [ON]

Expand All @@ -133,10 +113,10 @@ jobs:
uses: actions/checkout@v4

- name: CMake configure
run: cmake --preset default -Dmpi:BOOL=${{ matrix.mpi }} --install-prefix=${{ runner.temp }} -DBUILD_SHARED_LIBS:BOOL=${{ matrix.shared }} -DTEST_WITH_VALGRIND:BOOL=${{ matrix.valgrind }}
run: cmake --preset default -DSC_ENABLE_MPI:BOOL=${{ matrix.mpi }} -DSC_TEST_WITH_VALGRIND:BOOL=${{ matrix.valgrind }}

- name: CMake build
run: cmake --build --preset default --parallel
run: cmake --build --preset default

- name: CMake Test
run: ctest --preset default
Expand All @@ -151,16 +131,17 @@ jobs:
./build/Testing/Temporary/LastTest.log
mac:
# macos-14 is to use Apple Silicon hardware as most Apple users nowadays would have
# https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source/
runs-on: macos-14
name: CMake build on MacOS
name: macOS mpi=${{ matrix.mpi }} CC=${{ matrix.cc }} shared=${{ matrix.shared }}
timeout-minutes: 60

strategy:
matrix:
cc: [clang, gcc-13]
cc: [clang]
# gcc-13 is broken in general for macOS GItHub Actions, but works fine on real computers.
mpi: [true]
shared: [false]
# shared=true is not common usage, but let's test one case of it
include:
- shared: true
cc: clang
Expand All @@ -176,47 +157,12 @@ jobs:
- name: Install system dependencies
run: brew install open-mpi

- name: CMake configure
run: cmake --preset default --install-prefix=${{ runner.temp }} -DBUILD_SHARED_LIBS:BOOL=${{ matrix.shared }}

- name: CMake build
run: cmake --build --preset default --parallel

- name: CMake Test
run: ctest --preset default

- name: CMake install (for examples)
run: cmake --install build

- name: CMake configure examples
run: cmake -B example/build -S example -DCMAKE_PREFIX_PATH:PATH=${{ runner.temp }}

- name: CMake build examples
run: cmake --build example/build --parallel

- 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: mac-binary-archive-${{ matrix.cc }}-shared-${{ matrix.shared }}
path: build/package

- name: Upload log files
if: always()
uses: actions/upload-artifact@v4
with:
name: mac_cmake_log-${{ matrix.cc }}-shared-${{ matrix.shared }}
path: |
./build/CMakeFiles/CMakeConfigureLog.yaml
./build/Testing/Temporary/LastTest.log
- name: CMake composite steps (build, test, install, examples)
uses: ./.github/workflows/composite-cmake

windows:
runs-on: windows-latest
name: CMake build on Windows
name: Windows
timeout-minutes: 60

strategy:
Expand All @@ -231,8 +177,12 @@ jobs:
- uses: actions/checkout@v4
name: Checkout source code

- run: echo "CMAKE_INSTALL_PREFIX=$HOME/local" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- run: echo "CMAKE_PREFIX_PATH=$HOME/local" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- name: CMake configure without MPI
run: cmake --preset default -Dmpi:BOOL=no --install-prefix=${{ runner.temp }} -DBUILD_SHARED_LIBS:BOOL=${{ matrix.shared }}
run: cmake --preset default -DSC_ENABLE_MPI:BOOL=no -DSC_BUILD_SHARED_LIBS:BOOL=${{ matrix.shared }}

- name: CMake build
run: cmake --build --preset default --parallel
Expand All @@ -244,7 +194,7 @@ jobs:
run: cmake --install build

- name: CMake configure examples without MPI
run: cmake -B example/build -S example -DCMAKE_PREFIX_PATH:PATH=${{ runner.temp }}
run: cmake -B example/build -S example

- name: CMake build examples
run: cmake --build example/build --parallel
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/ci_darwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- "CMake*"
- ".github/workflows/ci.yml"
- ".github/workflows/ci_cmake.yml"
- ".github/workflows/composite-cmake/**"
pull_request:

jobs:
Expand All @@ -22,17 +23,16 @@ jobs:
steps:
- run: echo "This job is running on a ${{ runner.os }} server hosted by GitHub"

- uses: actions/checkout@v3
- uses: actions/checkout@main
name: Checkout source code

- name: Install system dependencies
run: brew install open-mpi ninja automake
run: brew install open-mpi libtool automake

- name: Run bootstrap script
run: ./bootstrap

- name: Make check without MPI, with debug
shell: bash
run: |
DIR="checkdebug" && mkdir -p "$DIR" && cd "$DIR"
../configure --enable-debug \
Expand All @@ -41,7 +41,6 @@ jobs:
make -j check V=0
- name: Make check with MPI and debug
shell: bash
run: |
DIR="checkMPIdebug" && mkdir -p "$DIR" && cd "$DIR"
../configure --enable-mpi --enable-debug \
Expand All @@ -50,7 +49,6 @@ jobs:
make -j check V=0
- name: Make check with MPI, debug and C++ compiler
shell: bash
run: |
DIR="checkMPIdebugCXX" && mkdir -p "$DIR" && cd "$DIR"
../configure --enable-mpi --enable-debug CC=mpicxx \
Expand All @@ -60,7 +58,7 @@ jobs:
- name: Upload log files
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@main
with:
name: darwin_log
path: |
Expand Down
Loading

0 comments on commit f8b7691

Please sign in to comment.