MAINT: Final setting for chapter 3 #182
This file contains 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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: Pytest | |
on: | |
push: | |
branches: ["main" , "develop"] | |
pull_request: | |
branches: ["main" , "develop"] | |
jobs: | |
test: | |
name: Test installation | |
runs-on: ubuntu-latest | |
env: | |
OMP_NUM_THREADS: 1 | |
MKL_NUM_THREADS: 1 | |
NUMEXPR_NUM_THREADS: 1 | |
OPENBLAS_NUM_THREADS: 1 | |
defaults: | |
run: | |
shell: bash -el {0} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.9", "3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
architecture: x64 | |
miniconda-version: "latest" | |
channel-priority: flexible | |
channels: conda, conda-forge | |
use-only-tar-bz2: true | |
auto-update-conda: true | |
auto-activate-base: true | |
activate-environment: test | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
echo ${{ github.workspace }} | |
# sudo apt-get install libglu1-mesa libxrender1 libxcursor1 libxft2 libxinerama1 ffmpeg libsm6 libxext6 | |
sudo apt-get install gdb libglu1 | |
conda install -c conda-forge petsc | |
conda install -c conda-forge petsc4py | |
python -m pip install --upgrade pip | |
python -m pip install --upgrade -r requirements.txt | |
- name: Install nfempy | |
run: | | |
python -m pip install . | |
python -m pip freeze | |
- name: Test geometry | |
run: | | |
python -m pytest tests/test_geometry | |
- name: Test meshing | |
run: | | |
python -m pytest tests/test_meshing | |
- name: Test PETSc import | |
run: | | |
python -c 'from petsc4py import PETSc' | |
- name: Test l2-projectors | |
run: | | |
export OPENBLAS_NUM_THREADS=1 | |
export OPENBLAS_MAIN_FREE=1 | |
gdb -ex r -ex bt --args python -m pytest tests/test_projectors |