Skip to content

Commit

Permalink
Merge branch 'main' into dokken/update-3D-1D
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgensd committed Dec 5, 2024
2 parents 9326658 + 08351d0 commit 58800e7
Show file tree
Hide file tree
Showing 242 changed files with 17,260 additions and 14,031 deletions.
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
58 changes: 37 additions & 21 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ on:
default: "main"
type: string
test_pypi_publish:
description: "Publish to Test PyPi (true | false)"
description: "Publish to Test PyPi"
default: false
type: boolean
pypi_publish:
description: "Publish to PyPi (true | false)"
description: "Publish to PyPi"
default: false
type: boolean

Expand All @@ -26,11 +26,11 @@ on:
default: "main"
type: string
test_pypi_publish:
description: "Publish to Test PyPi (true | false)"
description: "Publish to Test PyPi"
default: false
type: boolean
pypi_publish:
description: "Publish to PyPi (true | false))"
description: "Publish to PyPi"
default: false
type: boolean

Expand All @@ -40,7 +40,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout UFL
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ufl_ref }}

Expand All @@ -50,32 +50,48 @@ jobs:
- name: Build sdist and wheel
run: python -m build .

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
path: dist/*

upload_test_pypi:
name: Upload to test PyPI (optional)
if: ${{ github.event.inputs.test_pypi_publish == 'true' }}
needs: [build]
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/fenics-ufl
permissions:
id-token: write

steps:
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist

- name: Push to test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

upload_pypi:
name: Upload to PyPI (optional)
if: ${{ github.event.inputs.pypi_publish == 'true' }}
needs: [build]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/fenics-ufl
permissions:
id-token: write

steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist

- name: Push to PyPI
uses: pypa/[email protected]
if: ${{ github.event.inputs.pypi_publish == 'true' }}
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
repository_url: https://upload.pypi.org/legacy/

- name: Push to Test PyPI
uses: pypa/[email protected]
if: ${{ github.event.inputs.test_pypi_publish == 'true' }}
with:
user: __token__
password: ${{ secrets.PYPI_TEST_TOKEN }}
repository_url: https://test.pypi.org/legacy/
uses: pypa/gh-action-pypi-publish@release/v1
42 changes: 17 additions & 25 deletions .github/workflows/fenicsx-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,38 @@ jobs:
ffcx-tests:
name: Run FFCx tests
runs-on: ubuntu-latest

env:
CC: gcc-10
CXX: g++-10
PETSC_ARCH: linux-gnu-real-64

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: 3.12

- name: Install test dependencies
run: |
sudo apt-get install -y graphviz libgraphviz-dev ninja-build pkg-config
- name: Install UFL
run: |
pip3 install .
pip3 install --break-system-packages .
- name: Install Basix
run: |
python3 -m pip install git+https://github.com/FEniCS/basix.git
- name: Clone FFCx
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: ./ffcx
repository: FEniCS/ffcx
ref: main

- name: Install FFCx
run: |
cd ffcx
Expand All @@ -51,38 +53,27 @@ jobs:
dolfinx-tests:
name: Run DOLFINx tests
runs-on: ubuntu-latest
container: fenicsproject/test-env:nightly-openmpi
container: ghcr.io/fenics/test-env:current-openmpi

env:
CC: clang
CXX: clang++

PETSC_ARCH: linux-gnu-complex-32
PETSC_ARCH: linux-gnu-complex128-32
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
OMPI_MCA_rmaps_base_oversubscribe: 1
OMPI_MCA_plm: isolated
OMPI_MCA_btl_vader_single_copy_mechanism: none
OMPI_MCA_mpi_yield_when_idle: 1
OMPI_MCA_hwloc_base_binding_policy: none

steps:
- uses: actions/checkout@v2
- name: Install dependencies (Python)
run: |
python3 -m pip install --upgrade pip
- uses: actions/checkout@v4

- name: Install UFL
run: |
pip3 install .
pip3 install --break-system-packages .
- name: Install Basix and FFCx
run: |
python3 -m pip install git+https://github.com/FEniCS/basix.git
python3 -m pip install git+https://github.com/FEniCS/ffcx.git
python3 -m pip install --break-system-packages git+https://github.com/FEniCS/basix.git
python3 -m pip install --break-system-packages git+https://github.com/FEniCS/ffcx.git
- name: Clone DOLFINx
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: ./dolfinx
repository: FEniCS/dolfinx
Expand All @@ -92,6 +83,7 @@ jobs:
cmake -G Ninja -DCMAKE_BUILD_TYPE=Developer -B build -S dolfinx/cpp/
cmake --build build
cmake --install build
pip3 -v install --global-option build --global-option --debug dolfinx/python/
python3 -m pip install --break-system-packages -r dolfinx/python/build-requirements.txt
python3 -m pip -v install --break-system-packages --no-build-isolation --check-build-dependencies --config-settings=cmake.build-type="Developer" dolfinx/python/[ci]
- name: Run DOLFINx unit tests
run: python3 -m pytest -n auto dolfinx/python/test/unit
44 changes: 25 additions & 19 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
branches:
- "**"
tags:
- "v*"
- "**"
pull_request:
branches:
- main
Expand All @@ -20,66 +20,72 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
exclude:
- os: macos-latest
python-version: '3.8'
- os: macos-latest
python-version: '3.9'
include:
- os: windows-latest
python-version: '3.11'

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Lint with flake8
run: |
python -m pip install flake8
flake8 --statistics .
- name: Check documentation style
- name: Lint with ruff
run: |
python -m pip install pydocstyle
python -m pydocstyle .
pip install ruff
ruff check .
ruff format --check .
- name: Install UFL
run: python -m pip install .[ci]
- name: Run unit tests
run: |
python -m pytest -n auto --cov=ufl/ --junitxml=junit/test-results-${{ matrix.os }}-${{ matrix.python-version }}.xml test/
- name: Upload to Coveralls
if: ${{ github.repository == 'FEniCS/ufl' && github.head_ref == '' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8' }}
if: ${{ github.repository == 'FEniCS/ufl' && github.head_ref == '' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: coveralls

- name: Build documentation
run: |
cd doc/sphinx
make html
- name: Upload documentation artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: doc-${{ matrix.os }}-${{ matrix.python-version }}
path: doc/sphinx/build/html/
retention-days: 2
if-no-files-found: error

- name: Checkout FEniCS/docs
if: ${{ github.repository == 'FEniCS/ufl' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') ) && runner.os == 'Linux' && matrix.python-version == 3.8 }}
uses: actions/checkout@v2
if: ${{ github.repository == 'FEniCS/ufl' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') ) && runner.os == 'Linux' && matrix.python-version == 3.12 }}
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/ufl' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') ) && runner.os == 'Linux' && matrix.python-version == 3.8 }}
if: ${{ github.repository == 'FEniCS/ufl' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') ) && runner.os == 'Linux' && matrix.python-version == 3.12 }}
run: |
echo "VERSION_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Copy documentation into repository
if: ${{ github.repository == 'FEniCS/ufl' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') ) && runner.os == 'Linux' && matrix.python-version == 3.8 }}
if: ${{ github.repository == 'FEniCS/ufl' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') ) && runner.os == 'Linux' && matrix.python-version == 3.12 }}
run: |
cd docs
git rm -r --ignore-unmatch ufl/${{ env.VERSION_NAME }}
mkdir -p ufl/${{ env.VERSION_NAME }}
cp -r ../doc/sphinx/build/html/* ufl/${{ env.VERSION_NAME }}
- name: Commit and push documentation to FEniCS/docs
if: ${{ github.repository == 'FEniCS/ufl' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') ) && runner.os == 'Linux' && matrix.python-version == 3.8 }}
if: ${{ github.repository == 'FEniCS/ufl' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') ) && runner.os == 'Linux' && matrix.python-version == 3.12 }}
run: |
cd docs
git config --global user.email "[email protected]"
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/spack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Spack build

on:
# Uncomment the below 'push' to trigger on push
# push:
# branches:
# - "**"
schedule:
# '*' is a special character in YAML, so string must be quoted
- cron: "0 2 * * WED"
workflow_dispatch:
inputs:
spack_repo:
description: "Spack repository to test"
default: "spack/spack"
type: string
spack_ref:
description: "Spack repository branch/tag to test"
default: "develop"
type: string

jobs:
build:
runs-on: ubuntu-latest
container: ubuntu:latest
steps:
- name: Install Spack requirements
run: |
apt-get -y update
apt-get install -y bzip2 curl file git gzip make patch python3-minimal tar xz-utils
apt-get install -y g++ gfortran # compilers
- name: Get Spack
if: github.event_name != 'workflow_dispatch'
uses: actions/checkout@v4
with:
path: ./spack
repository: spack/spack
- name: Get Spack
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v4
with:
path: ./spack
repository: ${{ github.event.inputs.spack_repo }}
ref: ${{ github.event.inputs.spack_ref }}

- name: Install UFL development version and run tests
run: |
. ./spack/share/spack/setup-env.sh
spack env create main
spack env activate main
spack add py-fenics-ufl@main
spack install --test=root
- name: Install UFL release version and run tests
run: |
. ./spack/share/spack/setup-env.sh
spack env create release
spack env activate release
spack add py-fenics-ufl
spack install --test=root
Loading

0 comments on commit 58800e7

Please sign in to comment.