Skip to content

Run Repository Tests #46

Run Repository Tests

Run Repository Tests #46

# Run the "Repository tests" with the following conditions.
# - dispatch
# - weekly
#
# The tests are run on the following repositories:
# - installing the package from the PyPi repository
# - installing the package from the Conda repository
#
# The tests are run on the following systems:
# - Linux / Ubuntu / Conda / PyPi
# - Microsoft / Windows / Conda / PyPi
# - Apple / macOS / Conda
#
# The tests are run on the following interpreter versions:
# - Python 3.10
# - Python 3.11
# - Python 3.12
#
# Thomas Guillod - Dartmouth College
# Mozilla Public License Version 2.0
name: Run Repository Tests
on:
workflow_dispatch:
schedule:
- cron: "0 2 * * 1"
env:
ALLOW_PLOTTING: "true"
PYTHONIOENCODING: "utf8"
PYTHONUNBUFFERED: "1"
CMD_EXTRACT: |
pypeec --version
pypeec examples .
CMD_SOLVE: |
pypeec mesher \
--geometry tutorial/geometry.yaml \
--voxel tutorial/voxel.json.gz
pypeec solver \
--voxel tutorial/voxel.json.gz \
--problem tutorial/problem.yaml \
--tolerance config/tolerance.yaml \
--solution tutorial/solution.json.gz
CMD_PLOT: |
pypeec viewer \
--voxel tutorial/voxel.json.gz \
--viewer config/viewer.yaml \
--plot_mode none
pypeec plotter \
--solution tutorial/solution.json.gz \
--plotter config/plotter.yaml \
--plot_mode none
jobs:
# ===================== run the tests with conda
conda:
strategy:
fail-fast: false
matrix:
system:
- "ubuntu-latest"
- "macos-latest"
- "windows-latest"
version:
- "3.10"
- "3.11"
- "3.12"
name: conda / ${{ matrix.system }} / ${{ matrix.version }}
runs-on: ${{ matrix.system }}
timeout-minutes: 20
steps:
- name: Set up Conda
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
python-version: ${{ matrix.version }}
auto-activate-base: false
activate-environment: pypeec
use-mamba: true
- name: Install dependencies
shell: bash -el {0}
run: |
conda install --yes conda-forge::pypeec
- name: Run the tests
shell: bash -el {0}
run: |
${{ env.CMD_EXTRACT }}
${{ env.CMD_SOLVE }}
${{ env.CMD_PLOT }}
# ===================== run the tests with pip
pip:
strategy:
fail-fast: false
matrix:
system:
- "ubuntu-latest"
- "windows-latest"
version:
- "3.10"
- "3.11"
- "3.12"
name: pip / ${{ matrix.system }} / ${{ matrix.version }}
runs-on: ${{ matrix.system }}
timeout-minutes: 20
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.version }}
- name: Install dependencies
shell: bash -el {0}
run: |
python -m pip install --upgrade pip
python -m pip install pypeec
- name: Run the tests
shell: bash -el {0}
run: |
${{ env.CMD_EXTRACT }}
${{ env.CMD_SOLVE }}
${{ env.CMD_PLOT }}