tests #267
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: | |
schedule: | |
# Run every Sunday | |
- cron: '0 0 * * 0' | |
workflow_dispatch: | |
jobs: | |
code-quality: | |
name: Code Quality | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r dev-requirements.txt | |
- name: Lint package | |
run: | | |
make lint | |
tests: | |
name: Tests (${{ matrix.os }}, Python ${{ matrix.python-version }}) | |
needs: code-quality | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: [3.7, 3.8, 3.9, "3.10"] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r dev-requirements.txt | |
- name: Test Package | |
run: | | |
make test | |
- name: Upload coverage to codecov | |
uses: codecov/codecov-action@v2 | |
with: | |
file: ./coverage.xml | |
fail_ci_if_error: true | |
if: matrix.os == 'ubuntu-latest' | |
- name: Build distribution and test installation | |
shell: bash | |
run: | | |
make dist | |
if [[ ${{ matrix.os }} == "windows-latest" ]]; then | |
PYTHON_BIN=Scripts/python | |
else | |
PYTHON_BIN=bin/python | |
fi | |
echo "=== Testing wheel installation ===" | |
python -m venv .venv-whl | |
.venv-whl/$PYTHON_BIN -m pip install --upgrade pip | |
.venv-whl/$PYTHON_BIN -m pip install dist/deon-*.whl | |
.venv-whl/$PYTHON_BIN -m deon --help | |
echo "=== Testing source installation ===" | |
python -m venv .venv-sdist | |
.venv-sdist/$PYTHON_BIN -m pip install --upgrade pip | |
.venv-sdist/$PYTHON_BIN -m pip install dist/deon-*.tar.gz --force-reinstall | |
.venv-sdist/$PYTHON_BIN -m deon --help | |
- name: Test Building Docs | |
run: | | |
make examples | |
make docs | |
notify: | |
name: Notify failed build | |
needs: [code-quality, tests] | |
if: failure() && github.event.pull_request == null | |
runs-on: ubuntu-latest | |
steps: | |
- uses: jayqi/failed-build-issue-action@v1 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} |