Skip to content

Run Package Tests

Run Package Tests #54

Workflow file for this run

# Run the "Package tests" with the following conditions.
# - dispatch
# - weekly
#
# The tests are run on the following environments:
# - using the "conda_base.yaml" file
# - using the "conda_dev.yaml" file
# - using the "requirements.txt" file
# - using the "pyproject.toml" file
#
# Thomas Guillod - Dartmouth College
# Mozilla Public License Version 2.0
name: Run Package Tests
on:
workflow_dispatch:
schedule:
- cron: "0 2 * * 1"
jobs:
# ===================== run the tests with conda
conda:
strategy:
fail-fast: false
matrix:
method:
- name: "base"
file: "conda_base.yaml"
- name: "dev"
file: "conda_dev.yaml"
name: conda / ${{ matrix.method.name }}
runs-on: "ubuntu-latest"
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Set up Conda
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
python-version: "3.11"
auto-activate-base: false
activate-environment: pypeec
environment-file: ${{ matrix.method.file }}
use-mamba: true
- name: Run the tests
shell: bash -el {0}
run: |
./scripts/run_tests.sh
# ===================== run the tests with pip
pip:
strategy:
fail-fast: false
matrix:
method:
- name: "list"
cmd: |
python -m pip install --upgrade pip
python -m pip install --requirement requirements.txt
- name: "package"
cmd: |
python -m pip install --upgrade pip
python -m pip install .
name: pip / ${{ matrix.method.name }}
runs-on: "ubuntu-latest"
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
shell: bash -el {0}
run: |
${{ matrix.method.cmd }}
- name: Run the tests
shell: bash -el {0}
run: |
./scripts/run_tests.sh