3333    name : Lint 
3434    steps :
3535      - uses : actions/checkout@v4 
36+       
3637      - name : Set up Python 
3738        uses : actions/setup-python@v5 
3839        with :
6061        run : | 
6162          cd cpp 
6263          clang-format --version 
63-           find . -type f \( -name "*.cpp" -o -name "*.h" \) ! -name "loguru.cpp"  | xargs clang-format --dry-run --Werror 
64+           find . -type f \( -name "*.cpp" -o -name "*.h" \) | xargs clang-format --dry-run --Werror 
6465name : clang-format Python binding checks (non-blocking) 
6566        continue-on-error : true 
6667        run : | 
8384
8485    name : Build and test 
8586    steps :
87+       - uses : actions/checkout@v4 
88+       
8689      - name : Install dependencies 
8790        run : | 
8891          sudo apt-get update 
9396          python-version : " 3.12" 
9497
9598      - name : Install Python build dependencies 
96-         run : pip install mpi4py nanobind scikit-build-core[pyproject] --upgrade 
99+         run : | 
100+           pip install --upgrade -r python/build-requirements.txt 
97101
98102name : Install FEniCS Python components (default branches/tags) 
99103        if : github.event_name != 'workflow_dispatch' 
@@ -108,8 +112,6 @@ jobs:
108112          pip install git+https://github.com/FEniCS/basix.git@${{ github.event.inputs.basix_ref }} 
109113          pip install git+https://github.com/FEniCS/ffcx.git@${{ github.event.inputs.ffcx_ref }} 
110114
111- uses : actions/checkout@v4 
112- 
113115name : Configure and install C++ 
114116        run : | 
115117          cmake -G Ninja -DDOLFINX_ENABLE_PETSC=false -DCMAKE_BUILD_TYPE=Developer -B build -S cpp/ 
@@ -129,12 +131,12 @@ jobs:
129131          mpirun -n 3 ctest -V --output-on-failure -R unittests 
130132
131133name : Build Python interface 
132-         run : pip install --check-build-dependencies --no-build-isolation --config-settings=cmake.build-type="Debug" python/ 
134+         run : pip install --check-build-dependencies --no-build-isolation --config-settings=cmake.build-type="Debug" ' python/[test]'  
133135
134-       - name : Install Python demo/test dependencies 
135-         run : pip install matplotlib pyamg pytest pytest-xdist scipy 
136136      - name : Run demos (Python, serial) 
137-         run : python -m pytest -n auto -m serial --durations=10 python/demo/test.py 
137+         run : | 
138+           pip install pytest-xdist 
139+           python -m pytest -n auto -m serial --durations=10 python/demo/test.py 
138140name : Run demos (Python, MPI (np=3)) 
139141        run : python -m pytest -m mpi --num-proc=3 python/demo/test.py 
140142      - name : Run unit tests 
@@ -165,9 +167,6 @@ jobs:
165167    steps :
166168      - uses : actions/checkout@v4 
167169
168-       - name : Install required Python packages (docs) 
169-         run : pip install breathe jupytext matplotlib myst_parser sphinx sphinx_rtd_theme 
170- 
171170      - name : Install FEniCS Python components (default branches/tags) 
172171        if : github.event_name != 'workflow_dispatch' 
173172        run : | 
@@ -188,14 +187,6 @@ jobs:
188187          cmake --build build 
189188          cmake --install build 
190189
191- name : Build C++ interface documentation 
192-         run : | 
193-           export DOLFINX_VERSION=`cmake -L build | grep DOXYGEN_DOLFINX_VERSION | cut -f2 -d "="` 
194-           echo $DOLFINX_VERSION 
195-           cd cpp/doc 
196-           doxygen Doxyfile 
197-           make html 
198- 
199190name : Build C++ unit tests 
200191        run : | 
201192          cmake -G Ninja -DCMAKE_BUILD_TYPE=Developer -B build/test/ -S cpp/test/ 
@@ -216,26 +207,22 @@ jobs:
216207          ctest -V -R demo -R serial 
217208          ctest -V -R demo -R mpi_2 
218209
219- name : Install required  Python ( build Python interface)  
220-         run : pip install nanobind scikit- build-core[pyproject]  
210+ name : Install Python build dependencies   
211+         run : pip install -r python/ build-requirements.txt   
221212
222213      - name : Build Python interface 
223214        run : | 
224-           pip install --check-build-dependencies --no-build-isolation --config-settings=cmake.build-type="Debug" python/ 
225- name : Build Python interface documentation 
226-         run : | 
227-           cd python/doc 
228-           python -m sphinx -W -b html source/ build/html/ 
215+           pip install --check-build-dependencies --no-build-isolation --config-settings=cmake.build-type="Debug" 'python/[test]' 
229216
230217name : Set default DOLFINx JIT options 
231218        run : | 
232219          mkdir -p ~/.config/dolfinx 
233220          echo '{ "cffi_extra_compile_args": ["-g0", "-O0" ] }' > ~/.config/dolfinx/dolfinx_jit_options.json 
234221
235- name : Install Python demo/test dependencies 
236-         run : pip install numba pyamg pytest pytest-xdist scipy 
237222name : Run demos (Python, serial) 
238-         run : python -m pytest -n auto -m serial --durations=10 python/demo/test.py 
223+         run : | 
224+           pip install pytest-xdist 
225+           python -m pytest -n auto -m serial --durations=10 python/demo/test.py 
239226name : Run demos (Python, MPI (np=3)) 
240227        run : python -m pytest -m mpi --num-proc=3 python/demo/test.py 
241228
@@ -244,9 +231,7 @@ jobs:
244231      - name : Run Python unit tests (MPI, np=3) 
245232        run : mpirun -np 3 python -m pytest -m "petsc4py or adios2" python/test/unit/ 
246233
247-   publish-docs :
248-     if : ${{ github.repository == 'FEniCS/dolfinx' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') ) }} 
249-     needs : build-with-petsc 
234+   build-and-publish-docs :
250235    runs-on : ubuntu-latest 
251236    container : " ghcr.io/fenics/test-env:current-openmpi" 
252237    env :
@@ -255,13 +240,10 @@ jobs:
255240      OMPI_ALLOW_RUN_AS_ROOT_CONFIRM : 1 
256241      PRTE_MCA_rmaps_default_mapping_policy : :oversubscribe 
257242
258-     name : Publish  docs
243+     name : Build and publish  docs
259244    steps :
260245      - uses : actions/checkout@v4 
261246
262-       - name : Install required Python packages (docs) 
263-         run : pip install breathe jupytext matplotlib myst_parser sphinx sphinx_rtd_theme 
264- 
265247      - name : Install FEniCS Python components (default branches/tags) 
266248        if : github.event_name != 'workflow_dispatch' 
267249        run : | 
@@ -281,34 +263,55 @@ jobs:
281263          cmake --build build 
282264          cmake --install build 
283265
266+ name : Build Python interface 
267+         run : | 
268+           pip install -r python/build-requirements.txt 
269+           pip install --check-build-dependencies --no-build-isolation --config-settings=cmake.build-type="Debug" 'python/[docs]' 
270+ 
284271name : Build C++ interface documentation 
285272        run : | 
286273          export DOLFINX_VERSION=`cmake -L build | grep DOXYGEN_DOLFINX_VERSION | cut -f2 -d "="` 
287274          echo $DOLFINX_VERSION 
288275          cd cpp/doc 
289276          doxygen Doxyfile 
290277          make html 
291- 
292- name : Install required Python (build Python interface) 
293-         run : pip install nanobind scikit-build-core[pyproject] 
294- 
295-       - name : Build Python interface 
296-         run : pip install --check-build-dependencies --no-build-isolation --config-settings=cmake.build-type="Debug" python/ 
278+ name : Upload C++ Doxygen documentation artifact 
279+         uses : actions/upload-artifact@v4 
280+         with :
281+           name : docs-cpp-doxygen 
282+           path : cpp/doc/html  
283+           retention-days : 2  
284+       - name : Upload C++ Sphinx documentation artifact 
285+         uses : actions/upload-artifact@v4 
286+         with :
287+           name : docs-cpp-sphinx 
288+           path : cpp/doc/build/html  
289+           retention-days : 2  
290+       
297291      - name : Build Python interface documentation 
298292        run : | 
299293          cd python/doc 
300294          python -m sphinx -W -b html source/ build/html/ 
295+ name : Upload Python documentation artifact 
296+         uses : actions/upload-artifact@v4 
297+         with :
298+           name : docs-python 
299+           path : python/doc/build/html  
300+           retention-days : 2  
301301
302302      - name : Checkout FEniCS/docs 
303+         if : ${{ github.repository == 'FEniCS/dolfinx' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') ) }} 
303304        uses : actions/checkout@v4 
304305        with :
305306          repository : " FEniCS/docs" 
306307          path : " docs" 
307308          ssh-key : " ${{ secrets.SSH_GITHUB_DOCS_PRIVATE_KEY }}" 
308309      - name : Set version name 
310+         if : ${{ github.repository == 'FEniCS/dolfinx' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') ) }} 
309311        run : | 
310312          echo "VERSION_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV 
311313name : Copy documentation into repository 
314+         if : ${{ github.repository == 'FEniCS/dolfinx' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') ) }} 
312315        run : | 
313316          cd docs 
314317          git rm -r --ignore-unmatch dolfinx/${{ env.VERSION_NAME }}/cpp 
@@ -320,6 +323,7 @@ jobs:
320323          cp -r ../cpp/doc/html/* dolfinx/${{ env.VERSION_NAME }}/cpp/doxygen 
321324          cp -r ../python/doc/build/html/* dolfinx/${{ env.VERSION_NAME }}/python 
322325name : Commit and push documentation to FEniCS/docs 
326+         if : ${{ github.repository == 'FEniCS/dolfinx' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') ) }} 
323327        run : | 
324328          cd docs 
325329          git config --global user.email "[email protected] " 
0 commit comments