forked from FEniCS/dolfinx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
General tidy and restrict cffi < 1.17 due to static condensation demo…
… issue (FEniCS#3343) * CFFI 1.17 seems to have issues with numba. * Clean up RedHat build. * Can people stop adding optional dependencies in CI runs? * Tidy. * Tidy. * General tidying. * Fix. * Remove logguru exception * Tidy up Dockerfile. * Fix. * Install cython for petsc4py build * Setuptools * Tweaks. * Fix. * Always build docs once and only push if on DOLFINx with main or v* tag. * Add back documentation artifacts. * Fix. * Fix. * Fix. * Need these, not installed (!). * petsc4py needs numpy. * Split apart numba/cffi and petsc/cffi definitions * Missing cffi! * Revert. * Try unpinning CFFI. * Does seem to be necessary. * Improve docstring.
- Loading branch information
1 parent
96d11d6
commit 805788a
Showing
9 changed files
with
107 additions
and
90 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 |
---|---|---|
|
@@ -33,6 +33,7 @@ jobs: | |
name: Lint | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
|
@@ -60,7 +61,7 @@ jobs: | |
run: | | ||
cd cpp | ||
clang-format --version | ||
find . -type f \( -name "*.cpp" -o -name "*.h" \) ! -name "loguru.cpp" | xargs clang-format --dry-run --Werror | ||
find . -type f \( -name "*.cpp" -o -name "*.h" \) | xargs clang-format --dry-run --Werror | ||
- name: clang-format Python binding checks (non-blocking) | ||
continue-on-error: true | ||
run: | | ||
|
@@ -83,6 +84,8 @@ jobs: | |
|
||
name: Build and test | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
|
@@ -93,7 +96,8 @@ jobs: | |
python-version: "3.12" | ||
|
||
- name: Install Python build dependencies | ||
run: pip install mpi4py nanobind scikit-build-core[pyproject] --upgrade | ||
run: | | ||
pip install --upgrade -r python/build-requirements.txt | ||
- name: Install FEniCS Python components (default branches/tags) | ||
if: github.event_name != 'workflow_dispatch' | ||
|
@@ -108,8 +112,6 @@ jobs: | |
pip install git+https://github.com/FEniCS/basix.git@${{ github.event.inputs.basix_ref }} | ||
pip install git+https://github.com/FEniCS/ffcx.git@${{ github.event.inputs.ffcx_ref }} | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Configure and install C++ | ||
run: | | ||
cmake -G Ninja -DDOLFINX_ENABLE_PETSC=false -DCMAKE_BUILD_TYPE=Developer -B build -S cpp/ | ||
|
@@ -129,12 +131,12 @@ jobs: | |
mpirun -n 3 ctest -V --output-on-failure -R unittests | ||
- name: Build Python interface | ||
run: pip install --check-build-dependencies --no-build-isolation --config-settings=cmake.build-type="Debug" python/ | ||
run: pip install --check-build-dependencies --no-build-isolation --config-settings=cmake.build-type="Debug" 'python/[test]' | ||
|
||
- name: Install Python demo/test dependencies | ||
run: pip install matplotlib pyamg pytest pytest-xdist scipy | ||
- name: Run demos (Python, serial) | ||
run: python -m pytest -n auto -m serial --durations=10 python/demo/test.py | ||
run: | | ||
pip install pytest-xdist | ||
python -m pytest -n auto -m serial --durations=10 python/demo/test.py | ||
- name: Run demos (Python, MPI (np=3)) | ||
run: python -m pytest -m mpi --num-proc=3 python/demo/test.py | ||
- name: Run unit tests | ||
|
@@ -165,9 +167,6 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install required Python packages (docs) | ||
run: pip install breathe jupytext matplotlib myst_parser sphinx sphinx_rtd_theme | ||
|
||
- name: Install FEniCS Python components (default branches/tags) | ||
if: github.event_name != 'workflow_dispatch' | ||
run: | | ||
|
@@ -188,14 +187,6 @@ jobs: | |
cmake --build build | ||
cmake --install build | ||
- name: Build C++ interface documentation | ||
run: | | ||
export DOLFINX_VERSION=`cmake -L build | grep DOXYGEN_DOLFINX_VERSION | cut -f2 -d "="` | ||
echo $DOLFINX_VERSION | ||
cd cpp/doc | ||
doxygen Doxyfile | ||
make html | ||
- name: Build C++ unit tests | ||
run: | | ||
cmake -G Ninja -DCMAKE_BUILD_TYPE=Developer -B build/test/ -S cpp/test/ | ||
|
@@ -216,26 +207,22 @@ jobs: | |
ctest -V -R demo -R serial | ||
ctest -V -R demo -R mpi_2 | ||
- name: Install required Python (build Python interface) | ||
run: pip install nanobind scikit-build-core[pyproject] | ||
- name: Install Python build dependencies | ||
run: pip install -r python/build-requirements.txt | ||
|
||
- name: Build Python interface | ||
run: | | ||
pip install --check-build-dependencies --no-build-isolation --config-settings=cmake.build-type="Debug" python/ | ||
- name: Build Python interface documentation | ||
run: | | ||
cd python/doc | ||
python -m sphinx -W -b html source/ build/html/ | ||
pip install --check-build-dependencies --no-build-isolation --config-settings=cmake.build-type="Debug" 'python/[test]' | ||
- name: Set default DOLFINx JIT options | ||
run: | | ||
mkdir -p ~/.config/dolfinx | ||
echo '{ "cffi_extra_compile_args": ["-g0", "-O0" ] }' > ~/.config/dolfinx/dolfinx_jit_options.json | ||
- name: Install Python demo/test dependencies | ||
run: pip install numba pyamg pytest pytest-xdist scipy | ||
- name: Run demos (Python, serial) | ||
run: python -m pytest -n auto -m serial --durations=10 python/demo/test.py | ||
run: | | ||
pip install pytest-xdist | ||
python -m pytest -n auto -m serial --durations=10 python/demo/test.py | ||
- name: Run demos (Python, MPI (np=3)) | ||
run: python -m pytest -m mpi --num-proc=3 python/demo/test.py | ||
|
||
|
@@ -244,9 +231,7 @@ jobs: | |
- name: Run Python unit tests (MPI, np=3) | ||
run: mpirun -np 3 python -m pytest -m "petsc4py or adios2" python/test/unit/ | ||
|
||
publish-docs: | ||
if: ${{ github.repository == 'FEniCS/dolfinx' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') ) }} | ||
needs: build-with-petsc | ||
build-and-publish-docs: | ||
runs-on: ubuntu-latest | ||
container: "ghcr.io/fenics/test-env:current-openmpi" | ||
env: | ||
|
@@ -255,13 +240,10 @@ jobs: | |
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1 | ||
PRTE_MCA_rmaps_default_mapping_policy: :oversubscribe | ||
|
||
name: Publish docs | ||
name: Build and publish docs | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install required Python packages (docs) | ||
run: pip install breathe jupytext matplotlib myst_parser sphinx sphinx_rtd_theme | ||
|
||
- name: Install FEniCS Python components (default branches/tags) | ||
if: github.event_name != 'workflow_dispatch' | ||
run: | | ||
|
@@ -281,34 +263,55 @@ jobs: | |
cmake --build build | ||
cmake --install build | ||
- name: Build Python interface | ||
run: | | ||
pip install -r python/build-requirements.txt | ||
pip install --check-build-dependencies --no-build-isolation --config-settings=cmake.build-type="Debug" 'python/[docs]' | ||
- name: Build C++ interface documentation | ||
run: | | ||
export DOLFINX_VERSION=`cmake -L build | grep DOXYGEN_DOLFINX_VERSION | cut -f2 -d "="` | ||
echo $DOLFINX_VERSION | ||
cd cpp/doc | ||
doxygen Doxyfile | ||
make html | ||
- name: Install required Python (build Python interface) | ||
run: pip install nanobind scikit-build-core[pyproject] | ||
|
||
- name: Build Python interface | ||
run: pip install --check-build-dependencies --no-build-isolation --config-settings=cmake.build-type="Debug" python/ | ||
- name: Upload C++ Doxygen documentation artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: docs-cpp-doxygen | ||
path: cpp/doc/html | ||
retention-days: 2 | ||
- name: Upload C++ Sphinx documentation artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: docs-cpp-sphinx | ||
path: cpp/doc/build/html | ||
retention-days: 2 | ||
|
||
- name: Build Python interface documentation | ||
run: | | ||
cd python/doc | ||
python -m sphinx -W -b html source/ build/html/ | ||
- name: Upload Python documentation artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: docs-python | ||
path: python/doc/build/html | ||
retention-days: 2 | ||
|
||
- name: Checkout FEniCS/docs | ||
if: ${{ github.repository == 'FEniCS/dolfinx' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') ) }} | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: "FEniCS/docs" | ||
path: "docs" | ||
ssh-key: "${{ secrets.SSH_GITHUB_DOCS_PRIVATE_KEY }}" | ||
- name: Set version name | ||
if: ${{ github.repository == 'FEniCS/dolfinx' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') ) }} | ||
run: | | ||
echo "VERSION_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
- name: Copy documentation into repository | ||
if: ${{ github.repository == 'FEniCS/dolfinx' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') ) }} | ||
run: | | ||
cd docs | ||
git rm -r --ignore-unmatch dolfinx/${{ env.VERSION_NAME }}/cpp | ||
|
@@ -320,6 +323,7 @@ jobs: | |
cp -r ../cpp/doc/html/* dolfinx/${{ env.VERSION_NAME }}/cpp/doxygen | ||
cp -r ../python/doc/build/html/* dolfinx/${{ env.VERSION_NAME }}/python | ||
- name: Commit and push documentation to FEniCS/docs | ||
if: ${{ github.repository == 'FEniCS/dolfinx' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') ) }} | ||
run: | | ||
cd docs | ||
git config --global user.email "[email protected]" | ||
|
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
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
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
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
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
Oops, something went wrong.