Skip to content

ufl4rom CI

ufl4rom CI #200

Workflow file for this run

name: ufl4rom CI
on:
push:
branches:
- "**"
pull_request:
branches:
- main
schedule:
- cron: "0 21 * * SAT"
workflow_dispatch:
jobs:
test:
if: >-
(
(
github.event_name == 'schedule'
&& github.repository == 'RBniCS/ufl4rom'
) || (
github.event_name != 'schedule'
&& !(
contains(github.event.head_commit.message, '[ci skip]')
|| contains(github.event.head_commit.message, '[skip ci]')
)
)
)
runs-on: ubuntu-latest
strategy:
matrix:
include:
- backend: none
container: ubuntu:rolling
setup_container: |
export DEBIAN_FRONTEND="noninteractive"
apt update -y -q
apt install -y -qq git python3-mpi4py python3-pip
rm /usr/lib/python3.*/EXTERNALLY-MANAGED
python3 -m pip -q install git+https://github.com/FEniCS/ufl.git
- backend: dolfinx-real
container: dolfinx/dolfinx:nightly
setup_container: |
. /usr/local/bin/dolfinx-real-mode
echo "PETSC_ARCH=$PETSC_ARCH" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> $GITHUB_ENV
- backend: dolfinx-complex
container: dolfinx/dolfinx:nightly
setup_container: |
. /usr/local/bin/dolfinx-complex-mode
echo "PETSC_ARCH=$PETSC_ARCH" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> $GITHUB_ENV
- backend: firedrake-real
container: firedrakeproject/firedrake
setup_container: |
echo "/home/firedrake/firedrake/bin" >> $GITHUB_PATH
- backend: firedrake-complex
container: firedrakeproject/firedrake-complex
setup_container: |
echo "/home/firedrake/firedrake/bin" >> $GITHUB_PATH
fail-fast: false
container:
image: ${{ matrix.container }}
options: --user root
steps:
- uses: actions/checkout@v3
- name: Setup container
run: ${{ matrix.setup_container }}
- name: Install ufl4rom
run: |
BACKEND=${{ matrix.backend }}
BACKEND=backend_${BACKEND%-*}
python3 -m pip install .[${BACKEND},docs,lint,tests]
shell: bash
- name: Run flake8 and mypy checks
run: |
python3 -m flake8 .
python3 -m mypy .
- name: Run documentation generation
run: |
cd docs && make html
- name: Run unit tests
run: |
COVERAGE_FILE=.coverage_unit python3 -m coverage run --source=ufl4rom -m pytest --random-order tests/unit
- name: Run integration tests
run: |
COVERAGE_FILE=.coverage_integration python3 -m coverage run --source=ufl4rom -m pytest --random-order tests/integration
- name: Upload coverage report as an artifact
uses: actions/upload-artifact@v3
with:
name: coverage-${{ matrix.backend }}
path: .coverage*
retention-days: 1
combine_coverage_reports:
runs-on: ubuntu-latest
container: ubuntu
needs: [test]
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
export DEBIAN_FRONTEND="noninteractive"
apt update -y -q
apt install -y -qq git python3-pip
pip3 -q install coverage
- name: Download coverage reports from artifacts
uses: actions/download-artifact@v3
- name: Combine coverage reports
run: |
python3 -m coverage combine coverage-*/.coverage*
python3 -m coverage report --fail-under=100 --show-missing --skip-covered
warn:
runs-on: ubuntu-latest
if: github.repository == 'RBniCS/ufl4rom' && github.ref == 'refs/heads/main' && github.event_name == 'schedule'
steps:
- uses: actions/checkout@v3
- name: Warn if scheduled workflow is about to be disabled
uses: fem-on-colab/warn-workflow-about-to-be-disabled-action@main
with:
workflow-filename: ci.yml
days-elapsed: 50