Develop #11
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: 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 |