Update unit tests #29
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: | |
- main | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Upgrade pip and setuptools | |
run: | | |
python -m pip install --upgrade pip setuptools | |
- name: Install package in development mode | |
run: | | |
pip install -e ".[develop]" | |
- name: Run flake8 | |
run: | | |
flake8 . --count --show-source --statistics | |
- name: Run mypy (package) | |
run: | | |
mypy -p doi2bibtex | |
- name: Run mypy (tests) | |
run: | | |
mypy tests | |
- name: Run pytest | |
run: | | |
pytest --cov-report term-missing --cov=doi2bibtex |