-
Notifications
You must be signed in to change notification settings - Fork 4
77 lines (74 loc) · 2.99 KB
/
tests-and-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
67
68
69
70
71
72
73
74
75
76
77
name: Run code coverage report
on:
push:
branches: "**"
permissions:
id-token: write
contents: read
jobs:
lite-tests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: .
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: run classification tests and report coverage
run: |
pip install -e "./src/[test]"
COVERAGE_FILE=.coverage.classification python -m coverage run --include "src/valor_lite/*" -m pytest -v tests/classification/
python -m coverage combine
python -m coverage report -m
python -m coverage json
export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])")
echo "total=$TOTAL" >> $GITHUB_ENV
if (( $TOTAL < 99 )); then
echo "Coverage is below 99%"
exit 1
fi
working-directory: .
- name: run object detection tests and report coverage
run: |
pip install -e "./src/[test]"
COVERAGE_FILE=.coverage.detection python -m coverage run --include "src/valor_lite/*" -m pytest -v tests/object_detection/
python -m coverage combine
python -m coverage report -m
python -m coverage json
export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])")
echo "total=$TOTAL" >> $GITHUB_ENV
if (( $TOTAL < 99 )); then
echo "Coverage is below 99%"
exit 1
fi
working-directory: .
- name: run semantic segmentation tests and report coverage
run: |
pip install -e "./src/[test]"
COVERAGE_FILE=.coverage.segmentation python -m coverage run --include "src/valor_lite/*" -m pytest -v tests/semantic_segmentation/
python -m coverage combine
python -m coverage report -m
python -m coverage json
export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])")
echo "total=$TOTAL" >> $GITHUB_ENV
if (( $TOTAL < 99 )); then
echo "Coverage is below 99%"
exit 1
fi
working-directory: .
- name: run text generation tests and report coverage
run: |
pip install -e "./src/[test,openai,mistral]"
COVERAGE_FILE=.coverage.text_generation python -m coverage run --include "src/valor_lite/*" -m pytest -v tests/text_generation/
python -m coverage combine
python -m coverage report -m
python -m coverage json
export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])")
echo "total=$TOTAL" >> $GITHUB_ENV
if (( $TOTAL < 99 )); then
echo "Coverage is below 99%"
exit 1
fi
working-directory: .