Skip to content

Commit a50a079

Browse files
authored
Merge branch 'firedrakeproject:main' into jrmaddison/transformed_functional
2 parents 751bca1 + 210b7c1 commit a50a079

File tree

223 files changed

+8378
-3780
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

223 files changed

+8378
-3780
lines changed

.github/workflows/core.yml

Lines changed: 105 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ on:
1515
description: Whether to run the test suite
1616
type: boolean
1717
default: true
18+
build_docs:
19+
description: Whether to build the documentation
20+
type: boolean
21+
default: true
1822
test_macos:
1923
description: Whether to test using macOS
2024
type: boolean
@@ -27,10 +31,6 @@ on:
2731
description: Whether to upload an sdist to PyPI
2832
type: boolean
2933
default: false
30-
upload_testpypi:
31-
description: Whether to upload an sdist to TestPyPI
32-
type: boolean
33-
default: false
3434

3535
workflow_dispatch:
3636
inputs:
@@ -46,6 +46,10 @@ on:
4646
description: Whether to run the test suite
4747
type: boolean
4848
default: true
49+
build_docs:
50+
description: Whether to build the documentation
51+
type: boolean
52+
default: true
4953
test_macos:
5054
description: Whether to test using macOS
5155
type: boolean
@@ -58,10 +62,6 @@ on:
5862
description: Whether to upload an sdist to PyPI
5963
type: boolean
6064
default: false
61-
upload_testpypi:
62-
description: Whether to upload an sdist to TestPyPI
63-
type: boolean
64-
default: false
6565

6666
concurrency:
6767
# Cancel running jobs if new commits are pushed
@@ -84,18 +84,16 @@ jobs:
8484
image: ubuntu:latest
8585
outputs:
8686
sdist_conclusion: ${{ steps.report_sdist.outputs.conclusion }}
87-
docs_conclusion: ${{ steps.report_docs.outputs.conclusion }}
8887
env:
8988
OMPI_ALLOW_RUN_AS_ROOT: 1
9089
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
9190
OMP_NUM_THREADS: 1
9291
OPENBLAS_NUM_THREADS: 1
9392
FIREDRAKE_CI: 1
94-
PYOP2_CI_TESTS: 1
9593
PYOP2_SPMD_STRICT: 1
9694
# NOTE: One should occasionally update test_durations.json by running
9795
# 'make test_durations' inside a 'firedrake:latest' Docker image.
98-
EXTRA_PYTEST_ARGS: --splitting-algorithm least_duration --timeout=600 --timeout-method=thread -o faulthandler_timeout=660 --durations-path=./firedrake-repo/tests/test_durations.json
96+
EXTRA_PYTEST_ARGS: --splitting-algorithm least_duration --timeout=600 --timeout-method=thread -o faulthandler_timeout=660 --durations-path=./firedrake-repo/tests/test_durations.json --durations=50
9997
PYTEST_MPI_MAX_NPROCS: 8
10098
steps:
10199
- name: Fix HOME
@@ -108,18 +106,6 @@ jobs:
108106
# Make sure the current directory is empty
109107
run: find . -delete
110108

111-
# Check that the Dockerfile is using the latest Ubuntu version.
112-
# The version is hardcoded into the Dockerfile so that the OS
113-
# for each release is fixed.
114-
- name: Check Dockerfile Ubuntu version
115-
run: |
116-
latest_version=$(grep "VERSION_ID=" /etc/os-release | cut -d '"' -f 2)
117-
docker_version=$(grep FROM docker/Dockerfile.vanilla | cut -d ':' -f 2)
118-
if [[ "$docker_version" != "$latest_version" ]]; then
119-
echo "Ubuntu version ${docker_version} in Dockerfile is out of date with latest version ${latest_version}"
120-
exit 1
121-
fi
122-
123109
# Use a different mirror to fetch apt packages from to get around
124110
# temporary outage.
125111
# (https://askubuntu.com/questions/1549622/problem-with-archive-ubuntu-com-most-of-the-servers-are-not-responding)
@@ -141,14 +127,17 @@ jobs:
141127
- name: Validate single source of truth
142128
run: ./firedrake-repo/scripts/check-config
143129

144-
# Raise an error if any 'TODO RELEASE' comments remain
145-
- name: Check no 'TODO RELEASE' comments (release only)
146-
if: inputs.target_branch == 'release'
147-
working-directory: firedrake-repo
130+
# Check that the Dockerfile is using the latest Ubuntu version.
131+
# The version is hardcoded into the Dockerfile so that the OS
132+
# for each release is fixed.
133+
- name: Check Dockerfile Ubuntu version
148134
run: |
149-
if [ -z "$( grep -r --exclude-dir='.*' 'TODO RELEASE' )" ]; then
150-
exit 0
151-
else
135+
latest_version=$(grep "VERSION_ID=" /etc/os-release | cut -d '"' -f 2)
136+
docker_version=$(grep FROM firedrake-repo/docker/Dockerfile.vanilla | cut -d ':' -f 2)
137+
echo "Latest version: $latest_version"
138+
echo "Docker version: $docker_version"
139+
if [[ "$docker_version" != "$latest_version" ]]; then
140+
echo "Ubuntu version ${docker_version} in Dockerfile is out of date with latest version ${latest_version}"
152141
exit 1
153142
fi
154143
@@ -205,7 +194,8 @@ jobs:
205194
: # because they rely on non-PyPI versions of petsc4py.
206195
pip install --no-build-isolation --no-deps \
207196
"$PETSC_DIR"/"$PETSC_ARCH"/externalpackages/git.slepc/src/binding/slepc4py
208-
pip install --no-deps git+https://github.com/NGSolve/ngsPETSc.git netgen-mesher netgen-occt
197+
# UNDO ME
198+
pip install --no-deps git+https://github.com/NGSolve/ngsPETSc.git@connorjward/ufl-cell-fix netgen-mesher netgen-occt
209199
210200
: # We have to pass '--no-build-isolation' to use a custom petsc4py
211201
EXTRA_BUILD_ARGS='--no-isolation'
@@ -214,12 +204,12 @@ jobs:
214204
215205
: # Install from an sdist so we can make sure that it is not ill-formed
216206
pip install build
217-
python -m build ./firedrake-repo --sdist "$EXTRA_BUILD_ARGS"
207+
python -m build ./firedrake-repo --sdist $EXTRA_BUILD_ARGS
218208
219209
pip install --verbose $EXTRA_PIP_FLAGS \
220210
--no-binary h5py \
221211
--extra-index-url https://download.pytorch.org/whl/cpu \
222-
"$(echo ./firedrake-repo/dist/firedrake-*.tar.gz)[ci,docs]"
212+
"$(echo ./firedrake-repo/dist/firedrake-*.tar.gz)[ci]"
223213
224214
firedrake-clean
225215
pip list
@@ -345,7 +335,7 @@ jobs:
345335
matrix.arch == 'default'
346336
run: |
347337
. venv/bin/activate
348-
git clone --depth 1 https://github.com/thetisproject/thetis.git thetis-repo
338+
git clone --depth 1 https://github.com/thetisproject/thetis.git thetis-repo --branch ${{ inputs.target_branch }}
349339
pip install --verbose ./thetis-repo
350340
python -m pytest -n 8 --verbose thetis-repo/test_adjoint/test_swe_adjoint.py
351341
timeout-minutes: 10
@@ -369,7 +359,7 @@ jobs:
369359
matrix.arch == 'default'
370360
run: |
371361
. venv/bin/activate
372-
git clone --depth 1 https://github.com/g-adopt/g-adopt.git g-adopt-repo
362+
git clone --depth 1 https://github.com/g-adopt/g-adopt.git g-adopt-repo --branch ${{ inputs.target_branch }}
373363
pip install --verbose ./g-adopt-repo
374364
make -C g-adopt-repo/demos/mantle_convection/base_case check
375365
timeout-minutes: 5
@@ -381,67 +371,6 @@ jobs:
381371
name: firedrake-logs-${{ matrix.arch }}
382372
path: pytest_*.log
383373

384-
- name: Install system dependencies (3)
385-
if: (success() || steps.install.conclusion == 'success') && matrix.arch == 'default'
386-
run: apt-get -y install inkscape texlive-full
387-
388-
- name: Check bibtex
389-
if: (success() || steps.install.conclusion == 'success') && matrix.arch == 'default'
390-
run: |
391-
. venv/bin/activate
392-
make -C firedrake-repo/docs validate-bibtex
393-
394-
- name: Check documentation links
395-
if: (success() || steps.install.conclusion == 'success') && matrix.arch == 'default'
396-
run: |
397-
. venv/bin/activate
398-
make -C firedrake-repo/docs linkcheck
399-
400-
- name: Build documentation
401-
if: (success() || steps.install.conclusion == 'success') && matrix.arch == 'default'
402-
id: build_docs
403-
run: |
404-
. venv/bin/activate
405-
cd firedrake-repo/docs
406-
make SPHINXOPTS="-t ${{ inputs.target_branch }}" html
407-
make latex
408-
make latexpdf
409-
# : Copy manual to HTML tree
410-
cp build/latex/Firedrake.pdf build/html/_static/manual.pdf
411-
412-
- name: Upload documentation
413-
uses: actions/upload-pages-artifact@v3
414-
id: upload_docs
415-
if: (success() || steps.build_docs.conclusion == 'success') && matrix.arch == 'default'
416-
with:
417-
name: github-pages
418-
path: firedrake-repo/docs/build/html
419-
retention-days: 1
420-
421-
- name: Report docs build status
422-
id: report_docs
423-
if: success() || steps.upload_docs.conclusion == 'success'
424-
run: echo "conclusion=success" >> "$GITHUB_OUTPUT"
425-
426-
# Some files are automatically generated when we install or build the
427-
# docs (e.g. AUTHORS.rst). These files are committed to the repository
428-
# so uncommitted changes at this point reflect changes in the automatically
429-
# generated files that ought to be committed.
430-
- name: Check no untracked files
431-
if: always()
432-
working-directory: firedrake-repo
433-
run: |
434-
if [ -z "$( git status --porcelain )" ]; then
435-
exit 0
436-
else
437-
echo Error: there are untracked files in the repository
438-
echo The output from 'git status' is:
439-
git status
440-
echo The output from 'git diff' is:
441-
git diff
442-
exit 1
443-
fi
444-
445374
- name: Post-run cleanup
446375
if: always()
447376
run: find . -delete
@@ -555,16 +484,94 @@ jobs:
555484
- name: Lint codebase
556485
run: make lint GITHUB_ACTIONS_FORMATTING=1
557486

487+
build_docs:
488+
if: inputs.build_docs
489+
name: Build documentation
490+
runs-on: [self-hosted, Linux]
491+
container:
492+
image: firedrakeproject/firedrake-vanilla-default:dev-${{ inputs.target_branch }}
493+
outputs:
494+
conclusion: ${{ steps.report_docs.outputs.conclusion }}
495+
steps:
496+
- name: Install system dependencies
497+
run: |
498+
apt-get update
499+
apt-get -y install inkscape texlive-full
500+
501+
- uses: actions/checkout@v5
502+
with:
503+
path: firedrake-repo
504+
ref: ${{ inputs.source_ref }}
505+
506+
- name: Install Firedrake
507+
id: install
508+
run: |
509+
CC=mpicc CXX=mpicxx \
510+
pip install --verbose --no-build-isolation './firedrake-repo[docs]'
511+
firedrake-clean
512+
pip list
513+
514+
- name: Check bibtex
515+
run: make -C firedrake-repo/docs validate-bibtex
516+
517+
- name: Check documentation links
518+
if: success() || steps.install.conclusion == 'success'
519+
run: make -C firedrake-repo/docs linkcheck
520+
521+
- name: Build documentation
522+
if: success() || steps.install.conclusion == 'success'
523+
id: build_docs
524+
working-directory: firedrake-repo/docs
525+
run: |
526+
make SPHINXOPTS="-t ${{ inputs.target_branch }}" html
527+
make latex
528+
make latexpdf
529+
# : Copy manual to HTML tree
530+
cp build/latex/Firedrake.pdf build/html/_static/manual.pdf
531+
532+
- name: Upload documentation
533+
uses: actions/upload-pages-artifact@v3
534+
id: upload_docs
535+
if: success() || steps.build_docs.conclusion == 'success'
536+
with:
537+
name: github-pages
538+
path: firedrake-repo/docs/build/html
539+
retention-days: 1
540+
541+
# Some files are automatically generated when we install or build the
542+
# docs (e.g. AUTHORS.rst). These files are committed to the repository
543+
# so uncommitted changes at this point reflect changes in the automatically
544+
# generated files that ought to be committed.
545+
- name: Check no untracked files
546+
if: always()
547+
working-directory: firedrake-repo
548+
run: |
549+
if [ -z "$( git status --porcelain )" ]; then
550+
exit 0
551+
else
552+
echo Error: there are untracked files in the repository
553+
echo The output from 'git status' is:
554+
git status
555+
echo The output from 'git diff' is:
556+
git diff
557+
exit 1
558+
fi
559+
560+
- name: Report docs build status
561+
id: report_docs
562+
if: success() || steps.upload_docs.conclusion == 'success'
563+
run: echo "conclusion=success" >> "$GITHUB_OUTPUT"
564+
558565
deploy_website:
559566
name: Deploy GitHub pages (optional)
560-
needs: test_linux
567+
needs: build_docs
561568
# Only deploy the website for main here, the release branch is managed
562569
# by https://github.com/firedrakeproject/firedrakeproject.github.io
563570
if: |
564571
always() &&
565572
inputs.deploy_website &&
566573
inputs.target_branch == 'main' &&
567-
needs.test_linux.outputs.docs_conclusion == 'success'
574+
needs.build_docs.outputs.conclusion == 'success'
568575
permissions:
569576
pages: write
570577
id-token: write
@@ -596,26 +603,3 @@ jobs:
596603
uses: pypa/gh-action-pypi-publish@release/v1
597604
with:
598605
password: ${{ secrets.PYPI_API_TOKEN }}
599-
600-
upload_testpypi:
601-
name: Upload to TestPyPI (optional)
602-
needs: test_linux
603-
if: |
604-
always() &&
605-
inputs.upload_testpypi &&
606-
inputs.target_branch == 'release' &&
607-
needs.test_linux.outputs.sdist_conclusion == 'success'
608-
runs-on: ubuntu-latest
609-
environment:
610-
name: testpypi
611-
permissions:
612-
id-token: write
613-
steps:
614-
- uses: actions/download-artifact@v4
615-
with:
616-
name: dist
617-
path: dist
618-
- name: Push to TestPyPI
619-
uses: pypa/gh-action-pypi-publish@release/v1
620-
with:
621-
repository-url: https://test.pypi.org/legacy/

0 commit comments

Comments
 (0)