-
-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
89 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
name: DOLFINx CI (macOS) | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- "main" | ||
tags: | ||
- "v*" | ||
merge_group: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: macos-14 | ||
strategy: | ||
matrix: | ||
with-petsc: [true, false] | ||
name: Build and test (with-petsc=${{ matrix.with-petsc }}) | ||
|
||
steps: | ||
- name: Install Homebrew dependencies | ||
run: brew install adios2 boost cmake hdf5-mpi make ninja open-mpi pkg-config pugixml spdlog bison flex gfortran scotch | ||
|
||
- name: Install petsc | ||
if: ${{ matrix.with-petsc }} | ||
run: brew install petsc | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
|
||
- name: Install Python dependencies | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel | ||
python -m pip install cffi cppimport cython numba numpy pytest pytest-xdist scipy | ||
- name: Install FEniCSx dependencies | ||
run: | | ||
python -m pip install git+https://github.com/FEniCS/basix.git | ||
python -m pip install git+https://github.com/FEniCS/ufl.git | ||
python -m pip install git+https://github.com/FEniCS/ffcx.git | ||
- uses: actions/checkout@v4 | ||
with: | ||
path: dolfinx | ||
|
||
- name: Build and install DOLFINx C++ library | ||
working-directory: dolfinx | ||
run: | | ||
cmake -G Ninja -B build -S cpp/ | ||
cmake --build build | ||
sudo cmake --install build | ||
- name: Build C++ unit tests | ||
working-directory: dolfinx | ||
run: | | ||
cmake -G Ninja -DCMAKE_BUILD_TYPE=Developer -B build/test/ -S cpp/test/ | ||
cmake --build build/test --parallel 3 | ||
- name: Run C++ unit tests (serial) | ||
working-directory: dolfinx/build/test | ||
run: ctest -V --output-on-failure -R unittests | ||
|
||
- name: Run C++ unit tests (MPI) | ||
working-directory: dolfinx/build/test | ||
run: mpiexec -np 3 ctest -V --output-on-failure -R unittests | ||
|
||
- name: Build and install DOLFINx Python interface | ||
if: ${{ ! matrix.with-petsc }} | ||
working-directory: dolfinx/python | ||
run: | | ||
python -m pip install -r ./build-requirements.txt | ||
python -m pip install --check-build-dependencies --no-build-isolation . | ||
- name: Run Python unit tests (serial) | ||
if: ${{ ! matrix.with-petsc }} | ||
working-directory: dolfinx/python/test/unit/ | ||
run: python -m pytest -n auto -m "not petsc4py" . | ||
|
||
- name: Run Python unit tests (MPI, np=3) | ||
if: ${{ ! matrix.with-petsc }} | ||
working-directory: dolfinx/python/test/unit/ | ||
run: mpirun -np 3 python -m pytest -m "not petsc4py" . |