Fully integrate oomph_third_party_libraries repo code into main project. #540
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: oomph-lib self-tests (macOS) | |
on: | |
push: | |
paths: | |
# Only run the self-tests if we edited the demo drivers, sources, third-party | |
# library code or self-tests | |
- "demo_drivers/**" | |
- "external_distributions/CMakeLists.txt" | |
- "external_distributions/cmake/**" | |
- "external_src/**" | |
- "scripts/**" | |
- "self_test/**" | |
- "src/**" | |
# Don't run self-tests if we've just edited a Makefile.am | |
- "!**/.gitignore" | |
- "!**/README.md" | |
- "!**/Makefile.am" | |
# Environment variables that can be read during jobs | |
env: | |
CTEST_OUTPUT_ON_FAILURE: 1 | |
# Enable oversubscription for OpenMPI to handle MPI-enabled tests requiring | |
# more processors than are available | |
OMPI_MCA_rmaps_base_oversubscribe: 1 | |
# ------------------------------------------------------------------------------ | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
build_info: | |
[ | |
{ enable_mpi: "OFF", preset: ci }, | |
{ enable_mpi: "ON", preset: ci-mpi }, | |
] | |
build_third_party_libs: ["OFF", "ON"] | |
runs-on: macos-latest | |
steps: | |
# ------------------- | |
# INITIAL SETUP: | |
# ------------------- | |
- name: Check out oomph-lib repository | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: brew install ninja fd openblas gmp mpfr && brew reinstall gcc | |
- name: Install MPI dependencies (if required) | |
if: matrix.build_info.enable_mpi == 'ON' | |
run: brew install open-mpi | |
- name: Get CMake v3.24 | |
uses: lukka/get-cmake@latest | |
with: | |
cmakeVersion: "~3.24.0" | |
- name: Check CMake version | |
run: cmake --version | |
# ------------------- | |
# THIRD-PARTY LIBS: | |
# ------------------- | |
- name: Configure third-party libraries (optional) | |
if: matrix.build_third_party_libs == 'ON' | |
run: | | |
cmake -G Ninja \ | |
-DOOMPH_DISABLE_THIRD_PARTY_LIBRARY_TESTS=ON \ | |
-DOOMPH_ENABLE_MPI=${{ matrix.build_info.enable_mpi }} \ | |
-DOOMPH_USE_OPENBLAS_FROM=$(brew --prefix openblas) \ | |
-DOOMPH_USE_GMP_FROM=$(brew --prefix gmp) \ | |
-DOOMPH_USE_MPFR_FROM=$(brew --prefix mpfr) \ | |
-B build | |
working-directory: ./external_distributions/ | |
- name: Build third-party libraries (optional) | |
if: matrix.build_third_party_libs == 'ON' | |
run: cmake --build build | |
working-directory: ./external_distributions/ | |
- name: Upload third-party libraries build logs (optional) | |
if: matrix.build_third_party_libs == 'ON' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: third_party_build_logs-${{ runner.os }}-MPI_${{ matrix.build_info.enable_mpi }} | |
path: ./external_distributions/build/logs | |
# ------------------- | |
# BUILD MAIN PROJECT: | |
# ------------------- | |
- name: Configure | |
if: matrix.build_third_party_libs == 'OFF' | |
run: cmake --preset ${{ matrix.build_info.preset }} -DOOMPH_USE_BLAS_FROM=$(brew --prefix openblas) -B build | |
- name: Configure with third-party libs | |
if: matrix.build_third_party_libs == 'ON' | |
run: cmake --preset ${{ matrix.build_info.preset }} $(cat external_distributions/build/cmake_flags_for_oomph_lib.txt) -B build | |
- name: Build | |
run: cmake --build build | |
- name: Install | |
run: cmake --install build | |
# ------------------- | |
# BASIC SELF-TESTS: | |
# ------------------- | |
- name: Configure basic self-tests | |
run: cmake -G Ninja -S self_test -B self_test/build --log-level=VERBOSE | |
- name: Run basic self-tests | |
id: self_tests | |
run: ctest --preset ci --test-dir self_test/build -j $(sysctl -n hw.logicalcpu) | |
continue-on-error: true | |
# ------------------- | |
# DEMO DRIVERS: | |
# ------------------- | |
- name: Configure demo drivers | |
run: cmake -G Ninja -S demo_drivers -B demo_drivers/build --log-level=VERBOSE | |
- name: Run demo driver self-tests | |
id: demo_drivers | |
run: ctest --preset ci --test-dir demo_drivers/build -j $(sysctl -n hw.logicalcpu) | |
continue-on-error: true | |
# ------------------- | |
# UPLOAD STUFF: | |
# ------------------- | |
- name: Upload validation log file | |
uses: actions/upload-artifact@v3 | |
with: | |
name: validation-${{ runner.os }}-THIRD_PARTY_LIBS_${{ matrix.build_third_party_libs }}-MPI_${{ matrix.build_info.enable_mpi }}.log | |
path: ./validation.log | |
- name: Propagate CTest test status | |
if: steps.self_tests.outcome == 'failure' || steps.demo_drivers.outcome == 'failure' | |
run: exit 8 | |
# ------------------------------------------------------------------------------ |