Skip to content

Workflow file for this run

on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pre-commit
- name: Lint with pre-commit
run: pre-commit run --all-files
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
database_url:
- sqlite:///db.sqlite3
- mysql://root:test@127.0.0.1:3306/data_browser
- postgres://postgres:test@127.0.0.1:5432/data_browser
services:
mysql:
image: mysql:8.1.0
env:
MYSQL_ROOT_PASSWORD: test
ports:
- 3306:3306
postgres:
image: postgres:13.12
env:
POSTGRES_PASSWORD: test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
DATABASE_URL: ${{ matrix.database_url }}
TOX_PARALLEL_NO_SPINNER: 1
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox==4.11.4 tox-gh-actions
- name: Test with tox
run: tox
- name: Upload coverage data
uses: actions/upload-artifact@v2
with:
name: coverage-data
path: ".coverage.*"
coverage:
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install coverage[toml]
- name: Download coverage data.
uses: actions/download-artifact@v2
with:
name: coverage-data
- name: Combine coverage & fail if it's <100%.
run: |
python -m coverage combine
python -m coverage html
python -m coverage report --fail-under=100
- name: Upload HTML report if check failed.
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: html-report
path: htmlcov