Skip to content

Commit

Permalink
Remove bp5 and improve pipelines (#8)
Browse files Browse the repository at this point in the history
* Improve pipelines and skip bp5 test
  • Loading branch information
jorgensd authored Mar 21, 2023
1 parent 7bd0a91 commit 78c8204
Show file tree
Hide file tree
Showing 9 changed files with 148 additions and 125 deletions.
12 changes: 12 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Omit numba code for now due to
# https://github.com/numba/numba/issues/4268
[run]
omit = */numba/*
parallel = true
source = adios4dolfinx

[html]
directory= htmlcov

[xml]
output = coverage.xml
50 changes: 10 additions & 40 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,14 @@
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
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:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
workflow_call:

env:
# Directory that will be published on github pages
Expand All @@ -38,41 +28,21 @@ jobs:
# This action sets the current path to the root of your github repo
- uses: actions/checkout@v3

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

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

- name: Install dependencies
run: python3 -m pip install ".[docs]"
run: python3 -m pip install -e ".[docs]"

- name: Build docs
run: jupyter book build -W .

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
- name: Upload documentation as artifact
uses: actions/upload-artifact@v3
with:
name: documentation
path: ${{ env.PUBLISH_DIR }}

# Single deploy job since we're just deploying
deploy:
if: github.ref == 'refs/heads/main'
needs: build-docs
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Pages
uses: actions/configure-pages@v2
if-no-files-found: error


- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1

15 changes: 1 addition & 14 deletions .github/workflows/check_formatting.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
name: Check formatting

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

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

workflow_call:

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
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/create_legacy_data.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Generate legacy data

on:
workflow_call:

env:
data_dir: "legacy"


jobs:
create-data:
runs-on: "ubuntu-22.04"
container: ghcr.io/scientificcomputing/fenics:test_2023.1.0
steps:
- uses: actions/checkout@v3

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

- uses: actions/upload-artifact@v3
with:
name: ${{ env.data_dir }}
path: ./${{ env.data_dir }}
61 changes: 61 additions & 0 deletions .github/workflows/deploy_pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Github Pages

on:
push:
branches: [main]

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
build-docs:
uses: ./.github/workflows/build_docs.yml

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

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

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Download docs artifact
# docs artifact is uploaded by build-docs job
uses: actions/download-artifact@v3
with:
name: documentation
path: "./public"

- name: Download docs artifact
# docs artifact is uploaded by build-docs job
uses: actions/download-artifact@v3
with:
name: code-coverage-report
path: "./public/code-coverage-report"

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: "./public"

- name: Checkout
uses: actions/checkout@v3

- name: Setup Pages
uses: actions/configure-pages@v2

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
90 changes: 26 additions & 64 deletions .github/workflows/test_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,97 +10,59 @@ on:
branches:
- main

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


env:
data_dir: "legacy"

jobs:

create-datasets:
runs-on: "ubuntu-22.04"
container: ghcr.io/scientificcomputing/fenics:test_2023.1.0

steps:
- uses: actions/checkout@v3

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

- uses: actions/upload-artifact@v3
with:
name: ${{ env.data_dir }}
path: ./${{ env.data_dir }}

uses: ./.github/workflows/create_legacy_data.yml

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

test-code:
runs-on: "ubuntu-22.04"
needs: create-datasets
container: ghcr.io/fenics/test-env:nightly-mpich
# ghcr.io/fenics/dolfinx/dolfinx:nightly
needs: [create-datasets, check-formatting]
container: ghcr.io/fenics/dolfinx/dolfinx:nightly
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
DOLFINX_BRANCH: "main"
BASIX_BRANCH: "main"
UFL_BRANCH: "main"
FFCX_BRANCH: "main"
PETSC_ARCH: "linux-gnu-real-32"

steps:
- uses: actions/checkout@v3

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

- name: Get Basix
uses: actions/checkout@v3
with:
path: ./basix
repository: FEniCS/basix
ref: ${{ env.BASIX_BRANCH }}

- name: Install UFL, Basix, FFCx
run: |
cmake -G Ninja -B build-basix -DCMAKE_BUILD_TYPE="Release" -S ./basix/cpp/
cmake --build build-basix --parallel 3
cmake --install build-basix
BUILD_TYPE="Release" python3 -m pip install ./basix/python
python3 -m pip install git+https://github.com/FEniCS/ufl.git@${{ env.UFL_BRANCH }}
python3 -m pip install git+https://github.com/FEniCS/ffcx.git@${{ env.FFCX_BRANCH }}
- name: Get DOLFINx
uses: actions/checkout@v3
with:
path: ./dolfinx
repository: FEniCS/dolfinx
ref: ${{ env.DOLFINX_BRANCH }}

- name: Configure C++ (DOLFINx)
run:
cmake -G Ninja -DCMAKE_BUILD_TYPE="Release" -B build-dolfinx -S ./dolfinx/cpp/

- name: Build and install C++ library (DOLFINx)
run: |
cmake --build build-dolfinx
cmake --install build-dolfinx
- name: Build Python interface (dolfinx)
run: BUILD_TYPE="Release" python3 -m pip -v install ./dolfinx/python/

- name: Download legacy data
uses: actions/download-artifact@v3
with:
name: ${{ env.data_dir }}
path: ./${{ env.data_dir }}
name: legacy
path: ./legacy

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

- name: Run tests
run: python3 -m pytest
run: coverage run --rcfile=.coveragerc -m mpi4py -m pytest -xvs ./tests/

- name: Run tests in parallel
run: mpirun -n 2 python3 -m pytest
run: mpirun -n 2 coverage run --rcfile=.coveragerc -m mpi4py -m pytest -xvs ./tests/


- name: Combine coverage reports
run: |
coverage combine
coverage report -m
coverage html
- name: Upload coverage report as artifact
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: htmlcov
if-no-files-found: error
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,11 @@ dmypy.json

_build/

output/
output/

*.h5
.coverage.*
.coverage
*.h5
*.xdmf
*.bp/
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["setuptools>=61.0.0", "wheel"]

[project]
name = "adios4dolfinx"
version = "0.2.1"
version = "0.2.2"
description = "Wrappers for reading/writing DOLFINx meshes/functions with ADIOS2"
authors = [{name = "Jørgen S. Dokken", email = "[email protected]"}]
license = {file = "LICENSE"}
Expand All @@ -13,6 +13,7 @@ readme = "README.md"
[project.optional-dependencies]
test = [
"pytest",
"coverage"
]
dev = [
"pdbpp",
Expand Down
Loading

0 comments on commit 78c8204

Please sign in to comment.