4
4
workflow_call :
5
5
6
6
jobs :
7
- test_python :
8
- name : ${{ matrix.python-version }}
7
+ test_javascript :
8
+ name : javascript
9
9
runs-on : ubuntu-latest
10
+ steps :
11
+ - uses : actions/checkout@v3
12
+ - name : Use Node.js
13
+ uses : actions/setup-node@v3
14
+ with :
15
+ node-version : ' 16.x'
16
+ - name : Install dependencies
17
+ run : npm ci
18
+ - name : Run tests
19
+ run : npm run unit
20
+
21
+ test_unit :
22
+ name : ${{ matrix.os }} - ${{ matrix.python-version }}
23
+ runs-on : ${{ matrix.os }}
10
24
strategy :
11
25
fail-fast : false
12
26
matrix :
27
+ os : [ubuntu-latest, windows-latest, macos-latest]
28
+ python-version : ["3.7", "3.8", "3.9", "3.10"]
13
29
include :
14
- - tox-env : " py37"
15
- python-version : " 3.7"
16
-
17
- # https://github.com/pytest-dev/pytest-html/issues/585
18
- # - os: windows-latest
19
- # name: py37-windows
20
- # python-version: 3.7
30
+ - os : ubuntu-latest
31
+ python-version : " 3.10"
32
+ with-coverage : true
33
+
34
+ - os : ubuntu-latest
35
+ python-version : pypy3.9
36
+ tox-env : py3.9
37
+ - os : windows-latest
38
+ python-version : pypy3.9
39
+ tox-env : py3.9
40
+ - os : macos-latest
41
+ python-version : pypy3.9
42
+ tox-env : py3.9
43
+
44
+ - os : ubuntu-latest
45
+ python-version : 3.11-dev
46
+ tox-env : devel
47
+ - os : windows-latest
48
+ python-version : 3.11-dev
49
+ tox-env : devel
50
+ - os : macos-latest
51
+ python-version : 3.11-dev
52
+ tox-env : devel
21
53
22
- # https://github.com/pytest-dev/pytest-html/issues/585
23
- # - os: macOS-latest
24
- # name: py37-mac
25
- # python-version: 3.7
54
+ steps :
55
+ - name : Set newline behavior
56
+ run : git config --global core.autocrlf false
26
57
27
- - tox-env : " py38"
28
- python-version : " 3.8"
58
+ - uses : actions/checkout@v3
29
59
30
- # https://github.com/pytest-dev/pytest-html/issues/585
31
- # - os: windows-latest
32
- # name: py38-windows
33
- # python -version: 3.8
60
+ - name : Use Node.js
61
+ uses : actions/setup-node@v3
62
+ with :
63
+ node -version : ' 16.x '
34
64
35
- # https://github.com/pytest-dev/pytest-html/issues/585
36
- # - os: macOS-latest
37
- # name: py38-mac
38
- # python-version: 3.8
65
+ - name : Install dependencies
66
+ run : npm ci
39
67
40
- - tox-env : " py39 "
41
- python-version : " 3.9 "
68
+ - name : Build app
69
+ run : npm run build:ci
42
70
43
- - tox-env : " py310"
44
- python-version : " 3.10"
71
+ - name : Set up python
72
+ uses : actions/setup-python@v4
73
+ with :
74
+ python-version : ${{ matrix.python-version }}
45
75
46
- # https://github.com/pytest-dev/pytest-html/issues/585
47
- # - os: windows-latest
48
- # name: py39-windows
49
- # python-version: 3.9
76
+ - name : Install tox
77
+ run : python -m pip install --upgrade tox
50
78
51
- # https://github.com/pytest-dev/pytest-html/issues/585
52
- # - os: macOS-latest
53
- # name: py39-mac
54
- # python-version: 3.9
79
+ - name : Run unit tests
80
+ if : ${{ ! matrix.tox-env && matrix.with-coverage }}
81
+ run : tox -e py${{ matrix.python-version }}-cov -- testing/test_unit.py
55
82
56
- - tox-env : " pypy3 "
57
- python-version : " pypy3.9 "
58
- skip-coverage : true
83
+ - name : Run unit tests
84
+ if : ${{ ! matrix.tox-env && ! matrix.with-coverage }}
85
+ run : tox -e py${{ matrix.python-version }} -- testing/test_unit.py
59
86
60
- # https://github.com/pytest-dev/pytest-html/issues/585
61
- # - os: windows-latest
62
- # name: pypy3-windows
63
- # python-version: pypy3
87
+ - name : Run unit tests
88
+ if : ${{ matrix.tox-env }}
89
+ run : tox -e ${{ matrix.tox-env }} -- testing/test_unit.py
64
90
65
- # https://github.com/pytest-dev/pytest-html/issues/482
66
- # - os: macOS-latest
67
- # name: pypy3-mac
68
- # python-version: pypy-3.8
91
+ - name : Upload coverage to codecov
92
+ if : >-
93
+ ${{
94
+ ! github.event.schedule &&
95
+ matrix.with-coverage &&
96
+ github.repository_owner == 'pytest-dev'
97
+ }}
98
+ uses : codecov/codecov-action@v3
99
+ with :
100
+ fail_ci_if_error : true
101
+ files : ./coverage.xml
102
+ flags : tests
103
+ name : ${{ matrix.os }}-${{ matrix.python-version }}
104
+ verbose : true
69
105
70
- - tox-env : " devel"
71
- python-version : " 3.11-dev"
106
+ test_integration :
107
+ name : ubuntu - ${{ matrix.python-version }}
108
+ needs :
109
+ - test_javascript
110
+ - test_unit
111
+ runs-on : ubuntu-latest
112
+ strategy :
113
+ fail-fast : false
114
+ matrix :
115
+ python-version : ["3.7", "3.8", "3.9", "3.10"]
116
+ include :
117
+ - python-version : " 3.10"
118
+ with-coverage : true
119
+ - python-version : pypy3.9
120
+ tox-env : py3.9
121
+ - python-version : 3.11-dev
122
+ tox-env : devel
72
123
73
124
steps :
74
- - name : Set Newline Behavior
125
+ - name : Set newline behavior
75
126
run : git config --global core.autocrlf false
76
127
77
128
- uses : actions/checkout@v3
@@ -84,34 +135,38 @@ jobs:
84
135
with :
85
136
node-version : ' 16.x'
86
137
87
- - name : Install Dependencies
138
+ - name : Install dependencies
88
139
run : npm ci
89
140
90
141
- name : Build app
91
142
run : npm run build:ci
92
143
93
- - name : Set up Python
144
+ - name : Set up python
94
145
uses : actions/setup-python@v4
95
146
with :
96
147
python-version : ${{ matrix.python-version }}
97
148
98
149
- name : Install tox
99
150
run : python -m pip install --upgrade tox
100
151
101
- - name : Test with coverage
102
- if : ${{ ! matrix.skip -coverage }}
103
- run : tox -e ${{ matrix.tox-env }}-cov
152
+ - name : Run integration tests
153
+ if : ${{ ! matrix.tox-env && matrix.with -coverage }}
154
+ run : tox -e ${{ matrix.python-version }}-cov -- testing/test_integration.py
104
155
105
- - name : Test without coverage
106
- if : ${{ matrix.skip-coverage }}
107
- run : tox -e ${{ matrix.tox-env }}
156
+ - name : Run integration tests
157
+ if : ${{ ! matrix.tox-env && ! matrix.with-coverage }}
158
+ run : tox -e ${{ matrix.python-version }} -- testing/test_integration.py
159
+
160
+ - name : Run integration tests
161
+ if : ${{ matrix.tox-env }}
162
+ run : tox -e ${{ matrix.tox-env }} -- testing/test_integration.py
108
163
109
164
# TODO: https://github.com/pytest-dev/pytest-html/issues/481
110
165
- name : Upload coverage to codecov
111
166
if : >-
112
167
${{
113
168
! github.event.schedule &&
114
- ! matrix.skip -coverage &&
169
+ matrix.with -coverage &&
115
170
github.repository_owner == 'pytest-dev'
116
171
}}
117
172
uses : codecov/codecov-action@v3
@@ -121,17 +176,3 @@ jobs:
121
176
flags : tests
122
177
name : ${{ matrix.tox-env }}
123
178
verbose : true
124
-
125
- test_javascript :
126
- name : mocha
127
- runs-on : ubuntu-latest
128
- steps :
129
- - uses : actions/checkout@v3
130
- - name : Use Node.js
131
- uses : actions/setup-node@v3
132
- with :
133
- node-version : ' 16.x'
134
- - name : Install Dependencies
135
- run : npm ci
136
- - name : Mocha Tests
137
- run : npm run unit
0 commit comments