7
7
branches : [ main ]
8
8
9
9
env :
10
- python_cache_macOS_path : |
11
- ~/Library/Caches/pip
12
- python_cache_windows_path : |
13
- ~\AppData\Local\pip\Cache
14
- python_cache_ubuntu_path : |
15
- ~/.cache/pip
10
+ python_cache_macOS_path : ~/Library/Caches/pip
11
+ python_cache_windows_path : ~\AppData\Local\pip\Cache
12
+ python_cache_ubuntu_path : ~/.cache/pip
13
+ pipenv_version : 2021.11.9 # FIXME upgrade pipenv when https://github.com/pypa/pipenv/issues/4430 is actually fixed
14
+
16
15
jobs :
17
16
# Check that a news file has been added to this branch when a PR is created
18
17
assert-news :
@@ -57,10 +56,12 @@ jobs:
57
56
# normal dependencies from setup.py).
58
57
# This code also forces the system to install latest tools as the ones present on the CI system may be too old
59
58
# for the process to go through properly.
59
+ # FIXME upgrade pipenv when https://github.com/pypa/pipenv/issues/4430 is actually fixed
60
60
run : |
61
61
python -m pip install --upgrade pip wheel setuptools
62
- python -m pip install flake8 pipenv pytest
63
- python -m pipenv lock --dev -r --pre > dev-requirements.txt
62
+ python -m pip install pipenv==${{ env.pipenv_version }}
63
+ echo "Locking dependencies"
64
+ python -m pipenv lock --dev -r > dev-requirements.txt
64
65
- uses : FranzDiebold/github-env-vars-action@v2
65
66
- name : Load Python Dependencies from cache
66
67
uses : actions/cache@v2
@@ -94,10 +95,12 @@ jobs:
94
95
# normal dependencies from setup.py).
95
96
# This code also forces the system to install latest tools as the ones present on the CI system may be too old
96
97
# for the process to go through properly.
98
+ # FIXME upgrade when https://github.com/pypa/pipenv/issues/4430 is actually fixed
97
99
run : |
98
100
python -m pip install --upgrade pip wheel setuptools
99
- python -m pip install flake8 pipenv pytest
100
- python -m pipenv lock --dev -r --pre > dev-requirements.txt
101
+ python -m pip install pipenv==${{ env.pipenv_version }}
102
+ echo "Locking dependencies"
103
+ python -m pipenv lock --dev -r > dev-requirements.txt
101
104
- uses : FranzDiebold/github-env-vars-action@v2
102
105
- name : Load Python Dependencies from cache
103
106
uses : actions/cache@v2
@@ -150,28 +153,30 @@ jobs:
150
153
strategy :
151
154
fail-fast : false
152
155
matrix :
153
- os : [ubuntu-latest, macOS-latest, windows-latest]
156
+ os : [ubuntu-latest ] # FIXME add other platforms when much quicker macOS-latest, windows-latest]
154
157
python-version : ["3.7", "3.8", "3.9", "3.10"]
155
158
multi-platform :
156
159
- ${{ github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' }}
157
- # include:
158
- # - os: windows-latest
159
- # cache_path: ${{ env.python_cache_windows_path }}
160
- # - os: macOS-latest
161
- # cache_path: ${{ env.python_cache_macOS_path }}
162
- # - os: ubuntu-latest
163
- # cache_path: ${{ env.python_cache_ubuntu_path }}
164
- exclude :
160
+ # include:
161
+ # - os: windows-latest
162
+ # cache_path: ${{ env.python_cache_windows_path }}
163
+ # - os: macOS-latest
164
+ # cache_path: ${{ env.python_cache_macOS_path }}
165
+ # - os: ubuntu-latest
166
+ # cache_path: ${{ env.python_cache_ubuntu_path }}
167
+ # FIXME run on every platform as on Linux when speed is equivalent
168
+ include :
165
169
- os : macOS-latest
166
170
multi-platform : false
167
- - os : macOS-latest
168
- python-version : 3.10
169
- - os : macOS-latest
170
- python-version : 3.8
171
- - os : macOS-latest
172
- python-version : 3.7
171
+ python-version : 3.9
173
172
- os : windows-latest
174
173
multi-platform : false
174
+ python-version : 3.8
175
+ # exclude:
176
+ # - os: macOS-latest
177
+ # multi-platform: false
178
+ # - os: windows-latest
179
+ # multi-platform: false
175
180
176
181
name : Build and test
177
182
runs-on : ${{ matrix.os }}
@@ -181,31 +186,43 @@ jobs:
181
186
uses : actions/setup-python@v2
182
187
with :
183
188
python-version : ${{ matrix.python-version }}
189
+ - name : Install python tools
190
+ # This code forces the system to install latest tools as the ones present on the CI system may be too old
191
+ # for the process to go through properly.
192
+ run : |
193
+ python -m pip install --upgrade pip wheel setuptools
194
+ python -m pip install --upgrade flake8 pytest
195
+ - if : ${{ startsWith(matrix.os, 'windows') }}
196
+ run : python -m pip install pipenv
197
+ name : Install latest pipenv [${{ env.pipenv_version }}]
198
+ - if : ${{ !startsWith(matrix.os, 'windows') }}
199
+ run : python -m pip install pipenv==${{ env.pipenv_version }}
200
+ name : Install a fixed version of pipenv [${{ env.pipenv_version }}]
184
201
- name : Determine dependencies [OS:${{ matrix.os }}, Python:${{ matrix.python-version }}]
185
202
# Note
186
203
# The below code generates a pip requirements file from the pipenv development requirements (also obtaining the
187
204
# normal dependencies from setup.py).
188
- # This code also forces the system to install latest tools as the ones present on the CI system may be too old
189
- # for the process to go through properly.
190
205
run : |
191
- python -m pip install --upgrade pip wheel setuptools
192
- python -m pip install flake8 pipenv pytest
193
- python -m pipenv lock --dev -r --pre > dev-requirements.txt
206
+ python -m pipenv lock --dev -r > dev-requirements.txt
194
207
- if : ${{ startsWith(matrix.os, 'macOS') }}
195
208
run : echo "CACHE_PATH=${{ env.python_cache_macOS_path }}" >> $GITHUB_ENV
196
209
- if : ${{ startsWith(matrix.os, 'windows') }}
197
210
run : echo "CACHE_PATH=${{ env.python_cache_windows_path }}" >> $GITHUB_ENV
198
211
- if : ${{ startsWith(matrix.os, 'ubuntu') }}
199
212
run : echo "CACHE_PATH=${{ env.python_cache_ubuntu_path }}" >> $GITHUB_ENV
213
+ - name : Cache path to load
214
+ run : |
215
+ echo "Path to dependency cache: [${{ env.CACHE_PATH }}]"
200
216
- name : Load Python Dependencies from cache
217
+ if : ${{ ! startsWith(matrix.os, 'windows') }}
201
218
uses : actions/cache@v2
202
219
with :
203
220
path : ${{ env.CACHE_PATH }}
204
221
key : ${{ matrix.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/dev-requirements.txt') }}
205
222
restore-keys : |
206
223
${{ matrix.os }}-pip-${{ matrix.python-version }}
207
- # env:
208
- # CACHE_PATH: ${{ matrix.cache_path }}
224
+ # env:
225
+ # CACHE_PATH: ${{ matrix.cache_path }}
209
226
- name : Install dependencies
210
227
# Note
211
228
# As a virtual machine is already being used, pipenv
0 commit comments