-
Notifications
You must be signed in to change notification settings - Fork 8
123 lines (123 loc) · 4.19 KB
/
ci.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: Workflow for Codecov
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
codecov-python-39:
runs-on: windows-latest
env:
PYTHONTRACEMALLOC: 1
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: pip install coverage
- name: Run extension tests
continue-on-error: true
shell: cmd
run: |
cd ./src/extension/tests
echo '===============START EXTENSION TESTS...===============' >> ../../../err.txt
coverage run -m unittest discover -s . -t ../../ 2>> ../../../err.txt
echo '===============FINISH EXTENSION TESTS...===============' >> ../../../err.txt
- name: Run core tests
continue-on-error: true
shell: cmd
run: |
cd ./src/core/tests
echo '===============START CORE TESTS...===============' >> ../../../err.txt
coverage run -m unittest discover -s . -t ../../ 2>> ../../../err.txt
echo '===============FINISH CORE TESTS...===============' >> ../../../err.txt
- name: Collect coverage
run: |
cd ./src/core/tests
coverage xml
cd ../../extension/tests
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
flags: python39
name: python-39
fail_ci_if_error: true
- name: Read test output
id: getoutput
run: echo "::set-output name=contents::$(cat err.txt)"
- name: Check if all tests passed
if: contains( steps.getoutput.outputs.contents, 'FAILED (failures=' )
shell: cmd
run: |
echo "${{ steps.getoutput.outputs.contents }}"
exit 1
codecov-python-27:
runs-on: windows-latest
needs: codecov-python-39
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Restore Python 2.7 cache
uses: actions/cache@v2
with:
path: C:\Python27
key: python27-cache
- name: Install Python 2.7
shell: cmd
run: |
echo "check if python27 is not cached"
if not exist C:\Python27 (
choco install python2 -y
SETX PATH "%PATH%;C:\Python27"
)
- name: Cache dependencies
uses: actions/cache@v2
with:
path: '%UserProfile%\.cache\pip'
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
shell: cmd
run: pip install -r .github/workflows/requirements.txt
- name: Run extension tests
continue-on-error: true
shell: cmd
run: |
cd ./src/extension/tests
echo '===============START EXTENSION TESTS...===============' >> ../../../err2.txt
coverage run -m unittest discover -s . -t ../../ 2>> ../../../err2.txt
echo '===============FINISH EXTENSION TESTS...===============' >> ../../../err2.txt
- name: Run core tests
continue-on-error: true
shell: cmd
run: |
cd ./src/core/tests
echo '===============START CORE TESTS...===============' >> ../../../err2.txt
coverage run -m unittest discover -s . -t ../../ 2>> ../../../err2.txt
echo '===============FINISH CORE TESTS...===============' >> ../../../err2.txt
- name: Collect coverage
run: |
cd ./src/core/tests
coverage xml
cd ../../extension/tests
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
flags: python27
name: python-27
fail_ci_if_error: true
- name: Read test output
id: getoutput
run: echo "::set-output name=contents::$(cat err2.txt)"
- name: Check if all tests passed
if: contains( steps.getoutput.outputs.contents, 'FAILED (failures=' )
run: |
echo "${{ steps.getoutput.outputs.contents }}"
echo "There are failed tests"
exit 1