2020-06-13 21:36:49 +00:00
|
|
|
name: Calculate test coverage
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2020-07-31 23:23:02 +00:00
|
|
|
- main
|
2020-06-13 21:36:49 +00:00
|
|
|
pull_request:
|
|
|
|
branches:
|
2020-07-31 23:23:02 +00:00
|
|
|
- main
|
2020-06-13 21:36:49 +00:00
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Check out datasette
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up Python
|
2020-10-09 16:22:49 +00:00
|
|
|
uses: actions/setup-python@v2
|
2020-06-13 21:36:49 +00:00
|
|
|
with:
|
2020-10-09 16:22:49 +00:00
|
|
|
python-version: 3.9
|
2020-06-13 21:36:49 +00:00
|
|
|
- uses: actions/cache@v2
|
|
|
|
name: Configure pip caching
|
|
|
|
with:
|
|
|
|
path: ~/.cache/pip
|
|
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pip-
|
|
|
|
- name: Install Python dependencies
|
|
|
|
run: |
|
2020-08-11 23:12:05 +00:00
|
|
|
python -m pip install --upgrade pip
|
2020-06-13 21:36:49 +00:00
|
|
|
python -m pip install -e .[test]
|
|
|
|
python -m pip install pytest-cov
|
|
|
|
- name: Run tests
|
|
|
|
run: |-
|
|
|
|
ls -lah
|
|
|
|
cat .coveragerc
|
|
|
|
pytest --cov=datasette --cov-config=.coveragerc --cov-report xml:coverage.xml --cov-report term
|
|
|
|
ls -lah
|
|
|
|
- name: Upload coverage report
|
|
|
|
uses: codecov/codecov-action@v1
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
file: coverage.xml
|