Skip to content

Commit

Permalink
Merge branch 'main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgensd committed Apr 25, 2024
2 parents 0f6c52b + b7eb4a4 commit c68e831
Show file tree
Hide file tree
Showing 53 changed files with 4,248 additions and 1,283 deletions.
4 changes: 0 additions & 4 deletions .flake8

This file was deleted.

11 changes: 4 additions & 7 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages
name: Build documentation

on:
pull_request:
# The CI is executed on every pull request to the main branch
branches:
- main

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
workflow_call:

env:
# Directory that will be published on github pages
PUBLISH_DIR: ./_build/html
DEB_PYTHON_INSTALL_LAYOUT: deb_system
ARTIFACT_NAME: "docs"

jobs:
build-docs:
env:
PYTHONPATH: /usr/local/lib/python3/dist-packages:/usr/local/lib:/usr/local/dolfinx-real/lib/python3.10/dist-packages
DEB_PYTHON_INSTALL_LAYOUT: deb_system

runs-on: ubuntu-22.04
Expand All @@ -39,8 +35,9 @@ jobs:

- name: Upload documentation as artifact
uses: actions/upload-artifact@v4
if: github.event_name != 'workflow_call'
with:
name: documentation
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.PUBLISH_DIR }}
if-no-files-found: error

22 changes: 22 additions & 0 deletions .github/workflows/build_joss_paper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build JOSS paper
on: [push]

jobs:
paper:
runs-on: ubuntu-latest
name: Paper Draft
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build draft PDF
uses: openjournals/openjournals-draft-action@master
with:
journal: joss
paper-path: ./joss-paper/paper.md

- name: Upload
uses: actions/upload-artifact@v4
with:
name: paper
path: ./joss-paper/paper.pdf
7 changes: 4 additions & 3 deletions .github/workflows/check_formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
jobs:
check-code:
env:
PYTHONPATH: /usr/local/lib/python3/dist-packages:/usr/local/lib:/usr/local/dolfinx-real/lib/python3.10/dist-packages
DEB_PYTHON_INSTALL_LAYOUT: deb_system

runs-on: ubuntu-22.04
Expand All @@ -21,8 +20,10 @@ jobs:
- name: Install code
run: python3 -m pip install .[dev]

- name: Flake8 code
run: python3 -m flake8 -v
- name: Check code formatting with ruff
run: |
ruff check .
ruff format --check .
- name: Mypy check
run: python3 -m mypy -v
14 changes: 9 additions & 5 deletions .github/workflows/create_legacy_checkpoint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@ name: Generate adios4dolfinx legacy data

on:
workflow_call:

env:
data_dir: "legacy_checkpoint"
adios4dolfinx_version: "0.7.1"
inputs:
artifact_name:
type: string
required: true
description: "Name of the artifact to be created"

jobs:
create-adios-data:
env:
data_dir: "legacy_checkpoint"
adios4dolfinx_version: "0.7.1"
runs-on: "ubuntu-22.04"
container: ghcr.io/fenics/dolfinx/dolfinx:v0.7.3

Expand All @@ -23,5 +27,5 @@ jobs:

- uses: actions/upload-artifact@v4
with:
name: ${{ env.data_dir }}
name: ${{ inputs.artifact_name }}
path: ./${{ env.data_dir }}
29 changes: 17 additions & 12 deletions .github/workflows/create_legacy_data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,27 @@ name: Generate data from Legacy DOLFIN

on:
workflow_call:

env:
data_dir: "legacy"

inputs:
artifact_name:
type: string
required: true
description: "Name of the artifact to be created"

jobs:

create-dolfin-data:
env:
data_dir: "legacy"

runs-on: "ubuntu-22.04"
container: ghcr.io/scientificcomputing/fenics:2023-11-15
container: ghcr.io/scientificcomputing/fenics:2024-02-19
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Create datasets
run: python3 ./tests/create_legacy_data.py --output-dir=$data_dir
- name: Create datasets
run: python3 ./tests/create_legacy_data.py --output-dir=$data_dir

- uses: actions/upload-artifact@v4
with:
name: ${{ env.data_dir }}
path: ./${{ env.data_dir }}
- uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact_name }}
path: ./${{ env.data_dir }}
8 changes: 6 additions & 2 deletions .github/workflows/deploy_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@ jobs:
build-docs:
uses: ./.github/workflows/build_docs.yml


run-coverage:
uses: ./.github/workflows/test_package.yml

test-openmpi:
uses: ./.github/workflows/test_package_openmpi.yml

deploy:
needs: [run-coverage, build-docs]
needs: [run-coverage, build-docs, test-openmpi]

environment:
name: github-pages
Expand All @@ -35,7 +39,7 @@ jobs:
# docs artifact is uploaded by build-docs job
uses: actions/download-artifact@v4
with:
name: documentation
name: docs
path: "./public"

- name: Download docs artifact
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/test_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,25 @@ on:
- cron: "0 8 * * *"

jobs:

create-datasets:
uses: ./.github/workflows/create_legacy_data.yml
with:
artifact_name: "legacy_mpich"

create-legacy-datasets:
uses: ./.github/workflows/create_legacy_checkpoint.yml

with:
artifact_name: "legacy_checkpoint_mpich"

check-formatting:
uses: ./.github/workflows/check_formatting.yml

test-code:
runs-on: "ubuntu-22.04"
needs: [create-datasets, create-legacy-datasets, check-formatting]
container: ghcr.io/fenics/dolfinx/dolfinx:v0.7.3
container: ghcr.io/fenics/dolfinx/dolfinx:v0.8.0
env:
DEB_PYTHON_INSTALL_LAYOUT: deb_system
PYTHONPATH: /usr/local/lib/python3/dist-packages:/usr/local/lib:/usr/local/dolfinx-real/lib/python3.10/dist-packages

steps:
- uses: actions/checkout@v4
Expand All @@ -44,15 +46,15 @@ jobs:
- name: Download legacy data
uses: actions/download-artifact@v4
with:
name: legacy
name: legacy_mpich
path: ./legacy

- name: Download legacy data
uses: actions/download-artifact@v4
with:
name: legacy_checkpoint
name: legacy_checkpoint_mpich
path: ./legacy_checkpoint

- name: Install package
run: python3 -m pip install .[test]

Expand All @@ -62,7 +64,7 @@ jobs:
- name: Run tests in parallel
run: |
mpirun -n 2 coverage run --rcfile=.coveragerc -m mpi4py -m pytest -xvs ./tests/
mpirun -n 4 coverage run --rcfile=.coveragerc -m mpi4py -m pytest -xvs ./tests/
- name: Combine coverage reports
run: |
Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/test_package_openmpi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Test package with openmpi

on:
push:
# The CI is executed on every push on every branch
branches:
- "**"
pull_request:
# The CI is executed on every pull request to the main branch
branches:
- main

workflow_call:
workflow_dispatch:
schedule:
# The CI is executed every day at 8am
- cron: "0 8 * * *"

jobs:
create-datasets:
uses: ./.github/workflows/create_legacy_data.yml
with:
artifact_name: "legacy_ompi"

create-legacy-datasets:
uses: ./.github/workflows/create_legacy_checkpoint.yml
with:
artifact_name: "legacy_checkpoint_ompi"

test-code:
runs-on: "ubuntu-22.04"
needs: [create-datasets, create-legacy-datasets]
container: ghcr.io/fenics/test-env:current-openmpi
env:
DEB_PYTHON_INSTALL_LAYOUT: deb_system
PETSC_ARCH: "linux-gnu-real64-32"
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
PRTE_MCA_rmaps_default_mapping_policy: :oversubscribe

strategy:
matrix:
adios2: ["default", "v2.10.0"]
steps:
- uses: actions/checkout@v4

- name: Update pip
run: python3 -m pip install --upgrade pip setuptools

- name: Install DOLFINx
uses: jorgensd/actions/[email protected]
with:
adios2: ${{ matrix.adios2 }}
petsc_arch: ${{ env.PETSC_ARCH }}
dolfinx: v0.8.0
basix: v0.8.0
ufl: 2024.1.0.post0
ffcx: v0.8.0

- name: Download legacy data
uses: actions/download-artifact@v4
with:
name: legacy_ompi
path: ./legacy

- name: Download legacy data
uses: actions/download-artifact@v4
with:
name: legacy_checkpoint_ompi
path: ./legacy_checkpoint

- name: Install package
run: python3 -m pip install .[test]

- name: Run tests
run: |
coverage run --rcfile=.coveragerc -m mpi4py -m pytest -xvs ./tests/
- name: Run tests in parallel
run: |
mpirun -n 4 coverage run --rcfile=.coveragerc -m mpi4py -m pytest -xvs ./tests/
17 changes: 17 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: 'v0.2.2'
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ authors:
given-names: "Jørgen S."
orcid: "0000-0001-6489-8858"
title: "ADIOS2Wrappers"
version: "0.7.3"
date-released: "2023-02-08"
version: "0.8.1"
date-released: "2023-04-25"
Loading

0 comments on commit c68e831

Please sign in to comment.