Tests #139
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
name: Tests | |
on: | |
push: | |
branches: | |
- master | |
- main | |
pull_request: | |
branches: | |
- master | |
- main | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * 0' | |
env: | |
PACKAGE_NAME: pymer4 | |
defaults: | |
run: | |
# login shell to source the conda hook in .bash_profile | |
shell: | |
bash -l {0} | |
jobs: | |
ci: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
py_ver: [3.8, 3.9, '3.10', 3.11] | |
os: [ubuntu-latest] | |
steps: | |
# ------------------------------------------------------------ | |
# Step up miniconda | |
- name: Download Miniconda | |
uses: conda-incubator/setup-miniconda@059455a698430d8b68fa317268fa2e3da3492a98 | |
with: | |
miniconda-version: "latest" | |
python-version: ${{ matrix.py_ver }} | |
# ------------------------------------------------------------ | |
# Get code | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
# ------------------------------------------------------------ | |
# Setup conda build environment and build package | |
# env defined here are just for convenience when writing bash commands | |
- name: Install package | |
env: | |
PY_VER: ${{ matrix.py_ver }} | |
run: | | |
conda config --set always_yes yes --set changeps1 no | |
conda create -n pkg_test -c conda-forge python=$PY_VER 'r-lmerTest' 'r-emmeans' 'rpy2' | |
conda activate pkg_test | |
pip install -r requirements-dev.txt | |
pip install . | |
# ------------------------------------------------------------ | |
# Run tests | |
- name: Test installation and Run Test Suite | |
run: | | |
conda activate pkg_test | |
python -c "from pymer4.test_install import test_install; test_install()" | |
black --version | |
black --check --verbose . | |
pytest pymer4/tests | |
# ------------------------------------------------------------ | |
# Build docs | |
- name: Build Docs | |
run: | | |
conda activate pkg_test | |
cd docs && make clean && make html |