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
|
2022-05-31 19:28:40 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2020-06-13 21:36:49 +00:00
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Check out datasette
|
2024-01-31 23:31:26 +00:00
|
|
|
uses: actions/checkout@v4
|
2020-06-13 21:36:49 +00:00
|
|
|
- name: Set up Python
|
2024-01-31 23:31:26 +00:00
|
|
|
uses: actions/setup-python@v5
|
2020-06-13 21:36:49 +00:00
|
|
|
with:
|
2024-01-31 23:31:26 +00:00
|
|
|
python-version: '3.12'
|
|
|
|
cache: 'pip'
|
|
|
|
cache-dependency-path: '**/setup.py'
|
2020-06-13 21:36:49 +00:00
|
|
|
- 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
|