Update GitHub workflows to address deprecation of Python 2.7 from Git… #596
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 | |
- ".github/workflows/self-tests-macos.yaml" | |
- "cmake/**" | |
- "CMakeLists.txt" | |
- "demo_drivers/**" | |
- "external_distributions/CMakeLists.txt" | |
- "external_distributions/cmake/**" | |
- "external_src/**" | |
- "scripts/**" | |
- "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"] | |
name: All self-tests (MPI=${{ matrix.build_info.enable_mpi }}; TPL=${{matrix.build_third_party_libs}}) | |
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 Python 2.7 | |
uses: LizardByte/setup-python-action@master | |
with: | |
python-version: "2.7" | |
- 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 desired third-party libraries | |
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) \ | |
-DOOMPH_BUILD_MUMPS=ON \ | |
-DOOMPH_BUILD_SUPERLU_DIST=${{ matrix.build_info.enable_mpi }} \ | |
-DOOMPH_BUILD_CGAL=${{ matrix.build_third_party_libs }} \ | |
-DOOMPH_BUILD_HYPRE=${{ matrix.build_third_party_libs }} \ | |
-DOOMPH_BUILD_TRILINOS=${{ matrix.build_third_party_libs }} \ | |
-B build | |
working-directory: ./external_distributions/ | |
- name: Build desired third-party libraries | |
run: cmake --build build | |
working-directory: ./external_distributions/ | |
- name: Upload third-party libraries build logs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tpl_build_logs-${{ runner.os }}-ALL_TPL_${{ matrix.build_third_party_libs }}-MPI_${{ matrix.build_info.enable_mpi }} | |
path: ./external_distributions/build/logs | |
# ------------------- | |
# BUILD MAIN PROJECT: | |
# ------------------- | |
- name: Configure | |
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 | |
# ------------------- | |
# 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) -E mpi.multi_domain.pseudo_solid_collapsible_tube | |
continue-on-error: true | |
# ------------------- | |
# UPLOAD STUFF: | |
# ------------------- | |
- name: Upload validation log file | |
uses: actions/upload-artifact@v4 | |
with: | |
name: validation-${{ runner.os }}-TPL_${{ 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 | |
# ------------------------------------------------------------------------------ |