-
Notifications
You must be signed in to change notification settings - Fork 26
78 lines (67 loc) · 2.04 KB
/
Tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
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