3
3
# Based on ~/code/xcookie/xcookie/rc/tests.yml.in
4
4
# Now based on ~/code/xcookie/xcookie/builders/github_actions.py
5
5
6
- name : PurePy Build and Test
6
+ name : PurePyCI
7
7
8
8
on :
9
9
push :
@@ -16,10 +16,10 @@ jobs:
16
16
steps :
17
17
- name : Checkout source
18
18
uses : actions/checkout@v3
19
- - name : Set up Python 3.8
19
+ - name : Set up Python 3.11 for linting
20
20
21
21
with :
22
- python-version : 3.8
22
+ python-version : ' 3.11 '
23
23
- name : Install dependencies
24
24
run : |-
25
25
python -m pip install --upgrade pip
@@ -34,15 +34,15 @@ jobs:
34
34
mypy --install-types --non-interactive ./src/xdoctest
35
35
mypy ./src/xdoctest
36
36
build_and_test_sdist :
37
- name : Test sdist Python 3.8
37
+ name : Build sdist
38
38
runs-on : ubuntu-latest
39
39
steps :
40
40
- name : Checkout source
41
41
uses : actions/checkout@v3
42
- - name : Set up Python 3.8
42
+ - name : Set up Python 3.11
43
43
44
44
with :
45
- python-version : 3.8
45
+ python-version : ' 3.11 '
46
46
- name : Upgrade pip
47
47
run : |-
48
48
python -m pip install --upgrade pip
57
57
- name : Install sdist
58
58
run : |-
59
59
ls -al ./wheelhouse
60
- pip install wheelhouse/xdoctest*.tar.gz -v
60
+ pip install --prefer-binary wheelhouse/xdoctest*.tar.gz -v
61
61
- name : Test minimal loose sdist
62
62
run : |-
63
63
pwd
92
92
with :
93
93
name : wheels
94
94
path : ./wheelhouse/*.tar.gz
95
- build_and_test_purepy_wheels :
95
+ build_purepy_wheels :
96
96
name : ${{ matrix.python-version }} on ${{ matrix.os }}, arch=${{ matrix.arch }} with ${{ matrix.install-extras }}
97
97
runs-on : ${{ matrix.os }}
98
+ strategy :
99
+ matrix :
100
+ os :
101
+ - ubuntu-latest
102
+ python-version :
103
+ - ' 3.11'
104
+ arch :
105
+ - auto
106
+ steps :
107
+ - name : Checkout source
108
+ uses : actions/checkout@v3
109
+ - name : Set up QEMU
110
+ uses : docker/setup-qemu-action@v2
111
+ if : runner.os == 'Linux' && matrix.arch != 'auto'
112
+ with :
113
+ platforms : all
114
+ - name : Setup Python
115
+
116
+ with :
117
+ python-version : ${{ matrix.python-version }}
118
+ - name : Build pure wheel
119
+ shell : bash
120
+ run : |-
121
+ python -m pip install pip -U
122
+ python -m pip install setuptools>=0.8 build
123
+ python -m build --wheel --outdir wheelhouse
124
+ - name : Show built files
125
+ shell : bash
126
+ run : ls -la wheelhouse
127
+ - uses : actions/upload-artifact@v3
128
+ name : Upload wheels artifact
129
+ with :
130
+ name : wheels
131
+ path : ./wheelhouse/xdoctest*.whl
132
+ test_purepy_wheels :
133
+ name : ${{ matrix.python-version }} on ${{ matrix.os }}, arch=${{ matrix.arch }} with ${{ matrix.install-extras }}
134
+ runs-on : ${{ matrix.os }}
135
+ needs :
136
+ - build_purepy_wheels
98
137
strategy :
99
138
matrix :
100
139
include :
@@ -219,12 +258,12 @@ jobs:
219
258
uses : actions/checkout@v3
220
259
- name : Enable MSVC 64bit
221
260
uses : ilammy/msvc-dev-cmd@v1
222
- if : matrix.os == 'windows-latest' && matrix.cibw_skip == '*-win32'
223
- - name : Enable MSVC 32bit
224
- uses : ilammy/msvc-dev-cmd@v1
225
- if : matrix.os == 'windows-latest' && matrix.cibw_skip == '*-win_amd64'
226
- with :
227
- arch : x86
261
+ if : matrix.os == 'windows-latest' # && ${{ contains( matrix.cibw_skip, '*-win32') }}
262
+ # - name: Enable MSVC 32bit
263
+ # uses: ilammy/msvc-dev-cmd@v1
264
+ # if: matrix.os == 'windows-latest' && ${{ contains( matrix.cibw_skip, '*-win_amd64') }}
265
+ # with:
266
+ # arch: x86
228
267
- name : Set up QEMU
229
268
uses : docker/setup-qemu-action@v2
230
269
if : runner.os == 'Linux' && matrix.arch != 'auto'
@@ -234,49 +273,51 @@ jobs:
234
273
235
274
with :
236
275
python-version : ${{ matrix.python-version }}
237
- - name : Build pure wheel
238
- shell : bash
239
- run : |-
240
- python -m pip install pip -U
241
- python -m pip install setuptools>=0.8 build
242
- python -m build --wheel --outdir wheelhouse
276
+ - uses : actions/download-artifact@v3
277
+ name : Download wheels and sdist
278
+ with :
279
+ name : wheels
280
+ path : wheelhouse
243
281
- name : Test wheel with ${{ matrix.install-extras }}
244
282
shell : bash
245
283
env :
246
284
INSTALL_EXTRAS : ${{ matrix.install-extras }}
247
285
CI_PYTHON_VERSION : py${{ matrix.python-version }}
248
286
run : |-
249
- # Find the path to the wheel
250
- ls wheelhouse
287
+ echo "Finding the path to the wheel"
288
+ ls -al wheelhouse
289
+ echo "Installing helpers"
251
290
pip install tomli pkginfo
252
291
MOD_NAME=xdoctest
253
292
echo "MOD_NAME=$MOD_NAME"
254
293
WHEEL_FPATH=$(python -c "import pathlib; print(str(sorted(pathlib.Path('wheelhouse').glob('$MOD_NAME*.whl'))[-1]).replace(chr(92), chr(47)))")
255
294
echo "WHEEL_FPATH=$WHEEL_FPATH"
256
295
MOD_VERSION=$(python -c "from pkginfo import Wheel; print(Wheel('$WHEEL_FPATH').version)")
257
296
echo "MOD_VERSION=$MOD_VERSION"
258
- # Install the wheel (ensure we are using the version we just built)
297
+ echo " Install the wheel (ensureing we are using the version we just built)"
259
298
# NOTE: THE VERSION MUST BE NEWER THAN AN EXISTING PYPI VERSION OR THIS MAY FAIL
260
- pip install "$MOD_NAME[$INSTALL_EXTRAS]==$MOD_VERSION" -f wheelhouse
261
- # Create a sandboxed directory
299
+ pip install --prefer-binary "$MOD_NAME[$INSTALL_EXTRAS]==$MOD_VERSION" -f wheelhouse
300
+ echo "Install finished. Creating a sandbox directory to test it"
262
301
WORKSPACE_DNAME="testdir_${CI_PYTHON_VERSION}_${GITHUB_RUN_ID}_${RUNNER_OS}"
302
+ echo "WORKSPACE_DNAME=$WORKSPACE_DNAME"
263
303
mkdir -p $WORKSPACE_DNAME
304
+ echo "cd-ing into the workspace"
264
305
cd $WORKSPACE_DNAME
306
+ pwd
307
+ ls -al
308
+ pip freeze
265
309
# Get the path to the installed package and run the tests
266
310
MOD_DPATH=$(python -c "import xdoctest, os; print(os.path.dirname(xdoctest.__file__))")
267
311
echo "MOD_DPATH = $MOD_DPATH"
312
+ echo "running the pytest command inside the workspace"
268
313
python -m pytest -p pytester -p no:doctest --xdoctest --cov-config ../pyproject.toml --cov-report term --cov="$MOD_NAME" "$MOD_DPATH" ../tests
314
+ echo "pytest command finished, moving the coverage file to the repo root"
315
+ ls -al
269
316
# Move coverage file to a new name
270
317
mv .coverage "../.coverage.$WORKSPACE_DNAME"
318
+ echo "changing directory back to th repo root"
271
319
cd ..
272
- - name : Show built files
273
- shell : bash
274
- run : ls -la wheelhouse
275
- - name : Set up Python 3.8 to combine coverage Linux
276
-
277
- if : runner.os == 'Linux'
278
- with :
279
- python-version : 3.8
320
+ ls -al
280
321
- name : Combine coverage Linux
281
322
if : runner.os == 'Linux'
282
323
run : |-
@@ -295,18 +336,14 @@ jobs:
295
336
name : Codecov Upload
296
337
with :
297
338
file : ./tests/coverage.xml
298
- - uses : actions/upload-artifact@v3
299
- name : Upload wheels artifact
300
- with :
301
- name : wheels
302
- path : ./wheelhouse/xdoctest*.whl
303
339
test_deploy :
304
340
name : Uploading Test to PyPi
305
341
runs-on : ubuntu-latest
306
342
if : github.event_name == 'push' && ! startsWith(github.event.ref, 'refs/tags') && ! startsWith(github.event.ref, 'refs/heads/release')
307
343
needs :
308
344
- build_and_test_sdist
309
- - build_and_test_purepy_wheels
345
+ - build_purepy_wheels
346
+ - test_purepy_wheels
310
347
steps :
311
348
- name : Checkout source
312
349
uses : actions/checkout@v3
@@ -349,7 +386,8 @@ jobs:
349
386
if : github.event_name == 'push' && (startsWith(github.event.ref, 'refs/tags') || startsWith(github.event.ref, 'refs/heads/release'))
350
387
needs :
351
388
- build_and_test_sdist
352
- - build_and_test_purepy_wheels
389
+ - build_purepy_wheels
390
+ - test_purepy_wheels
353
391
steps :
354
392
- name : Checkout source
355
393
uses : actions/checkout@v3
@@ -405,4 +443,4 @@ jobs:
405
443
# --secret=EROTEMIC_TWINE_USERNAME=$EROTEMIC_TWINE_USERNAME \
406
444
# --secret=EROTEMIC_CI_SECRET=$EROTEMIC_CI_SECRET \
407
445
# --secret=EROTEMIC_TEST_TWINE_USERNAME=$EROTEMIC_TEST_TWINE_USERNAME \
408
- # --secret=EROTEMIC_TEST_TWINE_PASSWORD=$EROTEMIC_TEST_TWINE_PASSWORD
446
+ # --secret=EROTEMIC_TEST_TWINE_PASSWORD=$EROTEMIC_TEST_TWINE_PASSWORD
0 commit comments