-
Notifications
You must be signed in to change notification settings - Fork 88
67 lines (65 loc) · 1.87 KB
/
resotocore_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
61
62
63
64
65
66
# Note: the testing steps are the same as resotocore_test but with different python runner
# Reason: coverage under pypy is super slow!
name: Coverage (resotocore)
on:
push:
branches:
- main
paths:
- 'resotocore/**'
- '.github/**'
- 'requirements-all.txt'
pull_request:
paths:
- 'resotocore/**'
- '.github/**'
- 'requirements-all.txt'
jobs:
resotocore-coverage:
name: "Coverage (resotocore)"
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./resotocore
services:
arangodb:
image: arangodb:3.8.8
env:
ARANGO_NO_AUTH: 1
ports:
- 8529:8529
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: 'x64'
- name: Restore dependency cache
uses: actions/cache@v3
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{runner.os}}-pip-${{hashFiles('./resotocore/pyproject.toml')}}-${{hashFiles('./resotocore/requirements-test.txt')}}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r ../requirements-test.txt
pip install ../resotolib
- name: Run Tests
env:
RESOTOCORE_ANALYTICS_OPT_OUT: true
run: |
coverage run --source resotocore -m pytest
coverage combine
coverage xml
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v2
with:
files: resotocore/coverage.xml
flags: resotocore