-
Notifications
You must be signed in to change notification settings - Fork 0
126 lines (119 loc) · 3.48 KB
/
pythonpackage.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: build
on: [push]
jobs:
build:
runs-on: ubuntu-20.04
strategy:
max-parallel: 3
matrix:
python-version: [3.7, 3.8]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements_dev.txt
- name: Lint with flake8
run: |
flake8 pupil_recording_interface tests --ignore=E203,W503,W504 --exclude=**/externals
- name: Install package
run: python setup.py install
- name: Test with pytest
run: |
pytest
conda:
runs-on: ubuntu-20.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- uses: s-weigand/setup-conda@v1
- name: Check versions
run: |
conda --version
which python
- name: Create environment
run: |
conda install -y -c conda-forge mamba
mamba env create
- name: Install package
run: |
source activate pri
pip install --no-deps .
- name: Test with pytest
run: |
source activate pri
pytest
conda-build:
runs-on: ubuntu-20.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- uses: s-weigand/setup-conda@v1
- name: Check versions
run: |
conda --version
which python
- name: Set up build system
run: |
conda install -y -c conda-forge boa anaconda-client
conda config --set anaconda_upload no
- name: Run conda build
run: conda mambabuild build_tools/conda_recipe
- name: Upload to channel on tags
if: startsWith(github.ref, 'refs/tags/')
run: |
anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload -u vedb /usr/share/miniconda/conda-bld/noarch/pupil_recording_interface*.tar.bz2 --force
docs:
runs-on: ubuntu-20.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- uses: s-weigand/setup-conda@v1
- name: Check versions
run: |
conda --version
which python
- name: Create environment
run: |
conda install -y -c conda-forge mamba
mamba env create
- name: Install package
run: |
source activate pri
pip install --no-deps .
- name: Build Sphinx docs and run doctests
run: |
source activate pri
make -C docs/ html
make -C docs/ doctest
- name: Deploy docs on master
# if: github.ref == 'refs/heads/master'
run: |
sudo mkdir /docs -m 777
touch docs/_build/html/.nojekyll
mv docs/_build/html/* /docs
git config user.name CI
git config user.email ""
git checkout -f --orphan gh-pages
git rm --cached -rfq .
git clean -fxdq
mv /docs/* .
git add .
git commit -qm "Update docs"
git push -f --set-upstream origin gh-pages
black:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Check black code style
run: |
pip install click==8.0.2 black==19.10b0
black --check .