Skip to content

Utilise PetscSection to constrain essential boundary conditions #100

Utilise PetscSection to constrain essential boundary conditions

Utilise PetscSection to constrain essential boundary conditions #100

Workflow file for this run

name: CI-petsc
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- main
- petsc
pull_request:
branches:
- main
- petsc
jobs:
pytest:
name: ${{ matrix.name }}
runs-on: "${{ matrix.os }}"
env:
DOCKER_BUILDKIT: "1"
DEVITO_ARCH: "${{ matrix.arch }}"
DEVITO_LANGUAGE: ${{ matrix.language }}
strategy:
# Prevent all build to stop if a single one fails
fail-fast: false
# To be extended
matrix:
include:
- name: pytest-petsc
os: ubuntu-latest
arch: "gcc"
language: "C"
steps:
- name: Checkout devito
uses: actions/checkout@v4
- name: Log in to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build docker image
run: |
docker build \
-f docker/Dockerfile.petsc \
--build-arg PETSC_REPO=https://gitlab.com/ZoeLeibowitz/petsc.git \
--build-arg PETSC_BRANCH=zoe/feature-da-section-sf \
--tag devito_petsc_image:test .
- name: Set run prefix
run: |
echo "RUN_CMD=docker run --rm -t -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} --name testrun devito_petsc_image:test" >> $GITHUB_ENV
id: set-run
- name: Set tests
run : |
echo "TESTS=tests/test_petsc.py" >> $GITHUB_ENV
id: set-tests
- name: Check configuration
run: |
${{ env.RUN_CMD }} python3 -c "from devito import configuration; print(''.join(['%s: %s \n' % (k, v) for (k, v) in configuration.items()]))"
- name: Test with pytest - serial
run: |
${{ env.RUN_CMD }} mpiexec -n 1 pytest -m "not parallel" --cov --cov-config=.coveragerc --cov-report=xml ${{ env.TESTS }}
- name: Test with pytest - parallel
run: |
${{ env.RUN_CMD }} mpiexec -n 1 pytest -m parallel --cov --cov-config=.coveragerc --cov-report=xml ${{ env.TESTS }}
- name: Test examples
run: |
${{ env.RUN_CMD }} mpiexec -n 1 python3 examples/petsc/seismic/01_staggered_acoustic.py
${{ env.RUN_CMD }} mpiexec -n 1 python3 examples/petsc/cfd/01_navierstokes.py
${{ env.RUN_CMD }} mpiexec -n 1 python3 examples/petsc/Poisson/01_poisson.py
${{ env.RUN_CMD }} mpiexec -n 1 python3 examples/petsc/Poisson/02_laplace.py
${{ env.RUN_CMD }} mpiexec -n 1 python3 examples/petsc/Poisson/03_poisson.py
${{ env.RUN_CMD }} mpiexec -n 1 python3 examples/petsc/Poisson/04_poisson.py
${{ env.RUN_CMD }} mpiexec -n 1 python3 examples/petsc/random/01_helmholtz.py
${{ env.RUN_CMD }} mpiexec -n 1 python3 examples/petsc/random/02_biharmonic.py
- name: Upload coverage to Codecov
if: "!contains(matrix.name, 'docker')"
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: ${{ matrix.name }}