1
1
# merged in python-package.yml workflow
2
2
3
+ # reference docs:
4
+ # https://blog.deepjyoti30.dev/tests-github-python
5
+ # https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
6
+ # https://github.com/pypa/twine/blob/main/.github/workflows/main.yml
7
+
3
8
name : roundup-ci
4
9
5
10
on :
@@ -28,42 +33,48 @@ jobs:
28
33
name : CI build test
29
34
30
35
# run the finalizer for coveralls even if one or more
31
- # matrix runs fail.
32
- continue-on-error : true
36
+ # experimental matrix runs fail.
37
+ # continue-on-error: ${{ matrix.experimental }}
33
38
34
39
# runs-on: ubuntu-latest
35
40
# use below if running on multiple OS's.
36
41
runs-on : ${{ matrix.os }}
37
42
43
+ if : " !contains(github.event.head_commit.message, 'no-github-ci')"
44
+
38
45
strategy :
39
46
fail-fast : false
40
47
max-parallel : 4
41
48
matrix :
42
49
# Run in all these versions of Python
43
- python-version : [ "2.7", "3.10", "3.9", "3.8", "3.6", "3.11-dev" ]
50
+ python-version :
51
+ - " 2.7"
52
+ - " 3.10"
53
+ # - "3.9"
54
+ - " 3.8"
55
+ # - "3.7"
56
+ - " 3.11"
44
57
45
58
# use for multiple os or ubuntu versions
46
59
# os: [ubuntu-latest, macos-latest, windows-latest]
47
- os : [ubuntu-latest, ubuntu-22.04]
60
+ # ubuntu latest 22.04 12/2022
61
+ os : [ubuntu-latest, ubuntu-20.04]
48
62
49
63
# if the ones above fail. fail the build
50
64
experimental : [false]
51
65
52
66
include :
53
- # example: if 3.12 fails the jobs still succeeds
54
- # - python-version: 3.12
55
- # experimental: [true]
56
- # version 2.7 not available on unbuntu-22.04 github
57
- # - python-version: 2.7
58
- # os: ubuntu-22.04
59
- # experimental: true
60
- - python-version : 3.11-dev
67
+ # example: if 3.12 fails the jobs still succeeds
68
+ - python-version : 3.12
61
69
os : ubuntu-22.04
62
70
experimental : [true]
71
+ # 3.6 not available on new 22.04 runners, so run on 20.04 ubuntu
72
+ - python-version : 3.6
73
+ os : ubuntu-20.04
63
74
64
75
exclude :
65
- # skip all python versions on 22 .04 except explicitly included
66
- - os : ubuntu-22 .04
76
+ # skip all python versions on 20 .04 except explicitly included
77
+ - os : ubuntu-20 .04
67
78
68
79
env :
69
80
# get colorized pytest output even without a controlling tty
@@ -79,20 +90,25 @@ jobs:
79
90
# if: {{ false }}
80
91
# continue running if step fails
81
92
# continue-on-error: true
82
- uses : actions/checkout@v3
93
+ uses : actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
83
94
84
95
# Setup version of Python to use
85
96
- name : Set Up Python ${{ matrix.python-version }}
86
- uses : actions/setup-python@v4
97
+ uses : actions/setup-python@bd6b4b6205c4dbad673328db7b31b7fab9e241c0 # v4.6.1
87
98
with :
88
99
python-version : ${{ matrix.python-version }}
100
+ allow-prereleases : true
89
101
cache : ' pip'
90
102
103
+ - name : Install build tools - setuptools
104
+ run : pip install setuptools
105
+
91
106
# Display the Python version being used
92
107
- name : Display Python and key module versions
93
108
run : |
94
109
python -c "import sys; print('python version: ', sys.version)"
95
- python -c "import sqlite3; print('sqlite3 version, sqlite version: ', sqlite3.version, sqlite3.sqlite_version)"
110
+ python -c "import sqlite3; print('sqlite version: ', sqlite3.sqlite_version)"
111
+ python -c "import setuptools; print('setuptools version: ', setuptools.__version__);"
96
112
97
113
# Install the databases
98
114
- name : Install mysql/mariadb
@@ -114,7 +130,7 @@ jobs:
114
130
115
131
- name : Install postgres
116
132
run : |
117
- sudo apt-get install postgresql
133
+ sudo apt-get update && sudo apt-get install postgresql
118
134
# Disable fsync for speed, don't care about data durability
119
135
# when testing
120
136
sudo sed -i -e '$a\fsync = off' /etc/postgresql/*/*/postgresql.conf
@@ -157,7 +173,11 @@ jobs:
157
173
# older python and newest on newer.
158
174
if [[ $PYTHON_VERSION == "2."* ]]; then pip install sphinx==1.8.5; fi
159
175
if [[ $PYTHON_VERSION == '3.'* ]] ; then pip install sphinx; fi
160
- XAPIAN_VER=$(dpkg -l libxapian-dev | tail -n 1 | awk '{print $3}' | cut -d '-' -f 1); echo $XAPIAN_VER
176
+ if [[ $PYTHON_VERSION == '3.12'* ]] ; then \
177
+ XAPIAN_VER=1.4.22; \
178
+ else
179
+ XAPIAN_VER=$(dpkg -l libxapian-dev | tail -n 1 | awk '{print $3}' | cut -d '-' -f 1); echo $XAPIAN_VER; \
180
+ fi
161
181
cd /tmp
162
182
curl -s -O https://oligarchy.co.uk/xapian/$XAPIAN_VER/xapian-bindings-$XAPIAN_VER.tar.xz
163
183
tar -Jxvf xapian-bindings-$XAPIAN_VER.tar.xz
@@ -169,10 +189,10 @@ jobs:
169
189
# Change distutils.sysconfig... to just sysconfig and SO
170
190
# to EXT_SUFFIX to get valid value.
171
191
if [[ $PYTHON_VERSION == "3."* ]]; then sed -i -e '/PYTHON3_SO=/s/distutils\.//g' -e '/PYTHON3_SO=/s/"SO"/"EXT_SUFFIX"/g' configure; ./configure --prefix=$VIRTUAL_ENV --with-python3 --disable-documentation; fi
172
- case "$PYTHON_VERSION" in nightly) echo skipping xapian build;; *) make && sudo make install; esac
192
+ case "$PYTHON_VERSION" in nightly|3.12* ) echo skipping xapian build;; *) make && sudo make install; esac
173
193
174
194
- name : Install pytest and other packages needed for running tests
175
- run : pip install codecov flake8 mock pytest pytest-cov requests
195
+ run : pip install flake8 mock pytest pytest-cov requests
176
196
177
197
- name : Test build roundup and install locale so lang tests work.
178
198
run : |
@@ -194,6 +214,7 @@ jobs:
194
214
run : |
195
215
if [[ "$PYTHON_VERSION" != "2."* ]]; then
196
216
pytest -r a \
217
+ --durations=20 \
197
218
-W default \
198
219
-W "ignore:SelectableGroups:DeprecationWarning" \
199
220
-W "ignore:the imp module:DeprecationWarning:gpg.gpgme:15" \
@@ -207,20 +228,20 @@ jobs:
207
228
fi
208
229
else
209
230
# python2 case
210
- pytest -v -r a test/ --cov=roundup
231
+ pytest -v -r a --durations=20 test/ --cov=roundup
211
232
fi
212
233
213
234
- name : Upload coverage to Codecov
214
235
# see: https://github.com/codecov/codecov-action#usage
215
- uses : codecov/codecov-action@v3
236
+ uses : codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
216
237
with :
217
238
verbose : true
218
239
token : ${{ secrets.CODECOV_TOKEN }}
219
240
220
241
- name : Upload coverage to Coveralls
221
242
# python 2.7 and 3.6 versions of coverage can't produce lcov files.
222
243
if : matrix.python-version != '2.7' && matrix.python-version != '3.6'
223
- uses : coverallsapp/github-action@master
244
+ uses : coverallsapp/github-action@f350da2c033043742f89e8c0b7b5145a1616da6d # master
224
245
with :
225
246
github-token : ${{ secrets.GITHUB_TOKEN }}
226
247
path-to-lcov : coverage.lcov
@@ -247,13 +268,16 @@ jobs:
247
268
# -f scripts/Docker/Dockerfile .
248
269
249
270
250
- # in parallel build codecov requires a finish step
271
+ # in parallel build coveralls requires a finish step
251
272
finish :
252
273
needs : test
253
274
runs-on : ubuntu-latest
275
+
276
+ if : " !contains(github.event.head_commit.message, 'no-github-ci')"
277
+
254
278
steps :
255
279
- name : Coveralls Finished
256
- uses : coverallsapp/github-action@master
280
+ uses : coverallsapp/github-action@f350da2c033043742f89e8c0b7b5145a1616da6d # master
257
281
with :
258
282
github-token : ${{ secrets.github_token }}
259
283
parallel-finished : true
0 commit comments