-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (58 loc) · 1.72 KB
/
test-coverage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Calculate test coverage
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out dux
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Yarn install
run: yarn
- 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: |
python -m pip install --upgrade pip
python -m pip install -e .[test]
python -m pip install pytest-cov
- name: Run tests
run: |-
ls -lah
cat .coveragerc
pytest --cov=datasette_ui_extras --cov-config=.coveragerc --cov-report xml:coverage.xml --cov-report term
ls -lah
cp tests/diy-meta.db.orig diy.db
coverage run --append -m tests.e2e_test_host dux diy.db
coverage run --append -m tests.e2e_test_host yolo diy.db
coverage run --append -m tests.e2e_test_host serve diy.db --metadata metadata.e2e.json --port 8888 &
./node_modules/.bin/wait-on http://localhost:8888
./node_modules/.bin/cypress run
kill %1
coverage run --append -m tests.e2e_test_host undux diy.db
coverage xml -o coverage.xml
- name: Upload coverage report 1
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml