TL: mini fix for edge cases #2237
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: CI pipeline for pySDC | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '1 5 * * 1' | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
env: | |
YML: 'etc/environment-lint.yml' | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Install Conda environment with Micromamba | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: ${{ env.YML }} | |
create-args: >- | |
python=3.12 | |
- name: Code reformatting with black | |
run: | | |
black pySDC --check --diff --color | |
- name: Linting with ruff | |
run: | | |
ruff check pySDC | |
user_cpu_tests_linux: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
env: ['base', 'fenics', 'mpi4py', 'petsc', 'pytorch'] | |
python: ['3.9', '3.10', '3.11', '3.12'] | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Conda environment with Micromamba | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: "etc/environment-${{ matrix.env }}.yml" | |
create-args: >- | |
python=${{ matrix.python }} | |
- name: Install additional packages as needed | |
run: | | |
micromamba install -y --file etc/environment-tests.yml --freeze-installed | |
- name: Install pySDC as a package in the current environment | |
run: | | |
pip install --no-deps -e . | |
- name: Run pytest for CPU stuff | |
run: | | |
echo "print('Loading sitecustomize.py...') | |
import coverage | |
coverage.process_startup() " > sitecustomize.py | |
coverage run -m pytest --continue-on-collection-errors -v --durations=0 pySDC/tests -m ${{ matrix.env }} | |
- name: Make coverage report | |
run: | | |
coverage combine | |
mv .coverage coverage_${{ matrix.env }}.dat | |
- name: Uploading artifacts | |
uses: actions/upload-artifact@v4 | |
if: matrix.python == '3.12' | |
with: | |
name: test-artifacts-cpu-${{ matrix.env }} | |
path: | | |
data | |
coverage_${{ matrix.env }}.dat | |
project_cpu_tests_linux: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
env: | |
- AllenCahn_Bayreuth | |
- AsympConv | |
- DAE | |
- FastWaveSlowWave | |
- Hamiltonian | |
- matrixPFASST | |
- parallelSDC | |
- parallelSDC_reloaded | |
- PinTSimE | |
- RDC | |
- Resilience | |
- SDC_showdown | |
- Second_orderSDC | |
- soft_failure | |
- TOMS | |
python: ['3.9', '3.10', '3.11', '3.12'] | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Conda environment with Micromamba | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: "pySDC/projects/${{ matrix.env }}/environment.yml" | |
create-args: >- | |
python=${{ matrix.python }} | |
- name: Install additional packages as needed | |
run: | | |
micromamba install -y --file etc/environment-tests.yml --freeze-installed | |
- name: Run pytest for CPU stuff | |
run: | | |
echo "print('Loading sitecustomize.py...') | |
import coverage | |
coverage.process_startup() " > sitecustomize.py | |
coverage run -m pytest --continue-on-collection-errors -v --durations=0 pySDC/projects/${{ matrix.env }}/tests | |
- name: Make coverage report | |
run: | | |
coverage combine | |
mv .coverage coverage_${{ matrix.env }}.dat | |
- name: Uploading artifacts | |
uses: actions/upload-artifact@v4 | |
if: matrix.python == '3.12' | |
with: | |
name: test-artifacts-project-${{ matrix.env }} | |
path: | | |
data | |
coverage_${{ matrix.env }}.dat | |
user_libpressio_tests: | |
runs-on: ubuntu-latest | |
container: | |
image: brownbaerchen/libpressio:amd64_2 | |
volumes: | |
- ${{ github.workspace }}:/pySDC | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install pySDC and pytest | |
run: | | |
source /pySDC/pySDC/projects/compression/Docker/install_pySDC.sh | |
- name: Run pytest | |
run: | | |
source /opt/spack/share/spack/setup-env.sh | |
spack load libpressio | |
coverage run -m pytest --continue-on-collection-errors -v --durations=0 pySDC/projects/compression/tests -m libpressio | |
- name: Make coverage report | |
run: | | |
source /opt/spack/share/spack/setup-env.sh | |
spack load libpressio | |
mv data data_libpressio | |
coverage combine | |
mv .coverage coverage_libpressio.dat | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-artifacts-libpressio | |
path: | | |
data_libpressio | |
coverage_libpressio.dat | |
user_firedrake_tests: | |
runs-on: ubuntu-latest | |
container: | |
image: firedrakeproject/firedrake-vanilla-default:latest | |
options: --user root | |
volumes: | |
- ${{ github.workspace }}:/repositories | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Fix HOME | |
# For unknown reasons GitHub actions overwrite HOME to /github/home | |
# which will break everything unless fixed | |
# (https://github.com/actions/runner/issues/863) | |
run: echo "HOME=/home/firedrake" >> "$GITHUB_ENV" | |
- name: Checkout pySDC | |
uses: actions/checkout@v4 | |
with: | |
path: ./pySDC | |
- name: Checkout gusto | |
uses: actions/checkout@v4 | |
with: | |
repository: firedrakeproject/gusto | |
path: ./gusto_repo | |
- name: Create virtual environment | |
# pass '--system-site-packages' so Firedrake can be found | |
run: python3 -m venv --system-site-packages venv-pySDC | |
- name: Install pySDC | |
run: | | |
. venv-pySDC/bin/activate | |
pip install -e /repositories/pySDC | |
pip install qmat | |
# test installation | |
python -c "import pySDC; print(f'pySDC module: {pySDC}')" | |
- name: Install gusto | |
run: | | |
. venv-pySDC/bin/activate | |
pip install -e /repositories/gusto_repo | |
# test installation | |
python -c "import gusto; print(f'gusto module: {gusto}')" | |
- name: run pytest | |
run: | | |
. venv-pySDC/bin/activate | |
firedrake-clean | |
cd ./pySDC | |
python -m coverage run -m pytest --continue-on-collection-errors -v --durations=0 /repositories/pySDC/pySDC/tests -m firedrake | |
timeout-minutes: 45 | |
- name: Make coverage report | |
run: | | |
cd ./pySDC | |
mv data ../data_firedrake | |
coverage combine | |
mv .coverage ../coverage_firedrake.dat | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-artifacts-firedrake | |
path: | | |
data_firedrake | |
coverage_firedrake.dat | |
user_monodomain_tests_linux: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Conda environment with Micromamba | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: "pySDC/projects/Monodomain/etc/environment-monodomain.yml" | |
create-args: >- | |
python=3.12 | |
- name: Compile C++ ionic models | |
env: | |
IONIC_MODELS_PATH: "pySDC/projects/Monodomain/problem_classes/ionicmodels/cpp" | |
run: > | |
c++ -O3 -Wall -shared -std=c++11 -fPIC -fvisibility=hidden | |
$(python3 -m pybind11 --includes) | |
${IONIC_MODELS_PATH}/bindings_definitions.cpp | |
-o ${IONIC_MODELS_PATH}/ionicmodels$(python3-config --extension-suffix) | |
- name: Run pytest for CPU stuff | |
run: | | |
echo "print('Loading sitecustomize.py...') | |
import coverage | |
coverage.process_startup() " > sitecustomize.py | |
coverage run -m pytest --continue-on-collection-errors -v --durations=0 pySDC/projects/Monodomain/tests -m monodomain | |
- name: Make coverage report | |
run: | | |
mv data data_monodomain | |
coverage combine | |
mv .coverage coverage_monodomain.dat | |
- name: Uploading artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-artifacts-monodomain | |
path: | | |
data_monodomain | |
coverage_monodomain.dat |