forked from discopy/discopy
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (58 loc) · 1.65 KB
/
build_test.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
name: build
on: [push, pull_request]
env:
SRC_DIR: discopy
TEST_DIR: test
DOCS_DIR: docs
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.9 ]
steps:
- uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install linter
run:
python -m pip install pycodestyle coverage
- name: Check for errors
run:
# stop the build if there are Python syntax errors or undefined names
pycodestyle discopy
build_and_test:
needs: lint
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.9 ]
steps:
- uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install base package
run: pip install .
- name: Install coverage and pytest
run:
python -m pip install coverage pytest
- name: Install test dependencies
run:
python -m pip install -r ${{ env.TEST_DIR }}/requirements.txt
- name: Test with pytest
run:
coverage run --source=${{ env.SRC_DIR }} -m pytest ${{ env.SRC_DIR }} ${{ env.TEST_DIR }} --doctest-modules
- name: Coverage report
run:
coverage report --fail-under=99 --show-missing
- name: Linting
run:
pylint discopy
- name: Install nbmake and test notebooks
run: |
python -m pip install nbmake
pytest --nbmake ${{ env.DOCS_DIR }}/notebooks/*.ipynb