59
59
name : docs
60
60
path : site
61
61
62
- test-linux :
63
- name : test py${{ matrix.python-version }} on linux
62
+ test-linux-compiled :
63
+ name : test py${{ matrix.python-version }} on linux compiled
64
64
runs-on : ubuntu-latest
65
65
strategy :
66
66
fail-fast : false
@@ -78,10 +78,20 @@ jobs:
78
78
with :
79
79
python-version : ${{ matrix.python-version }}
80
80
81
+ - uses : actions/cache@v2
82
+ id : cache
83
+ with :
84
+ path : ${{ env.pythonLocation }}
85
+ key : >
86
+ ${{ runner.os }}
87
+ ${{ env.pythonLocation }}
88
+ ${{ hashFiles('setup.py') }}
89
+ ${{ hashFiles('requirements.txt') }}
90
+ ${{ hashFiles('tests/requirements-testing.txt') }}
91
+
81
92
- name : install
82
- run : |
83
- make install-testing
84
- pip freeze
93
+ if : steps.cache.outputs.cache-hit != 'true'
94
+ run : make install-testing
85
95
86
96
- name : compile
87
97
run : |
@@ -92,46 +102,29 @@ jobs:
92
102
93
103
- run : mkdir coverage
94
104
95
- - name : test compiled and deps
96
- run : make test
97
- env :
98
- COVERAGE_FILE : coverage/.coverage.linux-py${{ matrix.python-version }}-cY-dY
99
- CONTEXT : linux-py${{ matrix.python-version }}-compiled-yes-deps-yes
100
-
101
- - name : uninstall deps
102
- run : pip uninstall -y cython email-validator devtools python-dotenv
103
-
104
- - name : test compiled without deps
105
- run : make test
106
- env :
107
- COVERAGE_FILE : coverage/.coverage.linux-py${{ matrix.python-version }}-cY-dN
108
- CONTEXT : linux-py${{ matrix.python-version }}-compiled-yes-deps-no
109
-
110
- - name : remove compiled binaries
111
- run : |
112
- rm -r pydantic/*.so pydantic/*.c pydantic/__pycache__
113
- ls -alh
114
- ls -alh pydantic/
115
-
116
- - name : test uncompiled without deps
105
+ - name : test
117
106
run : make test
118
107
env :
119
- COVERAGE_FILE : coverage/.coverage.linux-py${{ matrix.python-version }}-cN-dN
120
- CONTEXT : linux-py${{ matrix.python-version }}-compiled-no-deps-no
108
+ COVERAGE_FILE : coverage/.coverage.linux-py${{ matrix.python-version }}-compiled
109
+ CONTEXT : linux-py${{ matrix.python-version }}-compiled
121
110
122
111
- name : store coverage files
123
112
uses : actions/upload-artifact@v2
124
113
with :
125
114
name : coverage
126
115
path : coverage
127
116
128
- test-windows-mac :
129
- name : test py${{ matrix.python-version }} on ${{ matrix.os }}
117
+ test-uncompiled :
118
+ name : test py${{ matrix.python-version }} on ${{ matrix.platform || matrix. os }}
130
119
strategy :
131
120
fail-fast : false
132
121
matrix :
133
- os : [macos, windows]
122
+ os : [ubuntu, macos, windows]
134
123
python-version : ['3.7', '3.8', '3.9', '3.10']
124
+ include :
125
+ - os : ubuntu
126
+ platform : linux
127
+
135
128
env :
136
129
PYTHON : ${{ matrix.python-version }}
137
130
OS : ${{ matrix.os }}
@@ -147,16 +140,40 @@ jobs:
147
140
with :
148
141
python-version : ${{ matrix.python-version }}
149
142
143
+ - uses : actions/cache@v2
144
+ id : cache
145
+ with :
146
+ path : ${{ env.pythonLocation }}
147
+ key : >
148
+ ${{ runner.os }}
149
+ ${{ env.pythonLocation }}
150
+ ${{ hashFiles('setup.py') }}
151
+ ${{ hashFiles('requirements.txt') }}
152
+ ${{ hashFiles('tests/requirements-testing.txt') }}
153
+
150
154
- name : install
151
155
run : make install-testing
156
+ if : steps.cache.outputs.cache-hit != 'true'
157
+
158
+ - run : pip freeze
159
+ if : steps.cache.outputs.cache-hit != 'true'
152
160
153
161
- run : mkdir coverage
154
162
155
- - name : test
163
+ - name : test with deps
164
+ run : make test
165
+ env :
166
+ COVERAGE_FILE : coverage/.coverage.${{ matrix.platform || matrix.os }}-py${{ matrix.python-version }}-with-deps
167
+ CONTEXT : ${{ matrix.platform || matrix.os }}-py${{ matrix.python-version }}-with-deps
168
+
169
+ - name : uninstall deps
170
+ run : pip uninstall -y cython email-validator devtools python-dotenv
171
+
172
+ - name : test without deps
156
173
run : make test
157
174
env :
158
- COVERAGE_FILE : coverage/.coverage.${{ matrix.os }}-py${{ matrix.python-version }}
159
- CONTEXT : ${{ matrix.os }}-py${{ matrix.python-version }}
175
+ COVERAGE_FILE : coverage/.coverage.${{ matrix.platform || matrix. os }}-py${{ matrix.python-version }}-without-deps
176
+ CONTEXT : ${{ matrix.platform || matrix. os }}-py${{ matrix.python-version }}-without-deps
160
177
161
178
- name : store coverage files
162
179
uses : actions/upload-artifact@v2
@@ -224,7 +241,7 @@ jobs:
224
241
225
242
- run : pip install coverage
226
243
227
- - run : ls -la
244
+ - run : ls -la coverage
228
245
- run : coverage combine coverage
229
246
- run : coverage report
230
247
- run : coverage html --show-contexts
0 commit comments