11# merged in python-package.yml workflow
22
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+
38name : roundup-ci
49
510on :
@@ -28,42 +33,48 @@ jobs:
2833 name : CI build test
2934
3035 # 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 }}
3338
3439 # runs-on: ubuntu-latest
3540 # use below if running on multiple OS's.
3641 runs-on : ${{ matrix.os }}
3742
43+ if : " !contains(github.event.head_commit.message, 'no-github-ci')"
44+
3845 strategy :
3946 fail-fast : false
4047 max-parallel : 4
4148 matrix :
4249 # 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"
4457
4558 # use for multiple os or ubuntu versions
4659 # 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]
4862
4963 # if the ones above fail. fail the build
5064 experimental : [false]
5165
5266 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
6169 os : ubuntu-22.04
6270 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
6374
6475 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
6778
6879 env :
6980 # get colorized pytest output even without a controlling tty
@@ -79,20 +90,25 @@ jobs:
7990 # if: {{ false }}
8091 # continue running if step fails
8192 # continue-on-error: true
82- uses : actions/checkout@v3
93+ uses : actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
8394
8495 # Setup version of Python to use
8596 - name : Set Up Python ${{ matrix.python-version }}
86- uses : actions/setup-python@v4
97+ uses : actions/setup-python@bd6b4b6205c4dbad673328db7b31b7fab9e241c0 # v4.6.1
8798 with :
8899 python-version : ${{ matrix.python-version }}
100+ allow-prereleases : true
89101 cache : ' pip'
90102
103+ - name : Install build tools - setuptools
104+ run : pip install setuptools
105+
91106 # Display the Python version being used
92107 - name : Display Python and key module versions
93108 run : |
94109 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__);"
96112
97113 # Install the databases
98114 - name : Install mysql/mariadb
@@ -114,7 +130,7 @@ jobs:
114130
115131 - name : Install postgres
116132 run : |
117- sudo apt-get install postgresql
133+ sudo apt-get update && sudo apt-get install postgresql
118134 # Disable fsync for speed, don't care about data durability
119135 # when testing
120136 sudo sed -i -e '$a\fsync = off' /etc/postgresql/*/*/postgresql.conf
@@ -157,7 +173,11 @@ jobs:
157173 # older python and newest on newer.
158174 if [[ $PYTHON_VERSION == "2."* ]]; then pip install sphinx==1.8.5; fi
159175 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
161181 cd /tmp
162182 curl -s -O https://oligarchy.co.uk/xapian/$XAPIAN_VER/xapian-bindings-$XAPIAN_VER.tar.xz
163183 tar -Jxvf xapian-bindings-$XAPIAN_VER.tar.xz
@@ -169,10 +189,10 @@ jobs:
169189 # Change distutils.sysconfig... to just sysconfig and SO
170190 # to EXT_SUFFIX to get valid value.
171191 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
173193
174194 - 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
176196
177197 - name : Test build roundup and install locale so lang tests work.
178198 run : |
@@ -194,6 +214,7 @@ jobs:
194214 run : |
195215 if [[ "$PYTHON_VERSION" != "2."* ]]; then
196216 pytest -r a \
217+ --durations=20 \
197218 -W default \
198219 -W "ignore:SelectableGroups:DeprecationWarning" \
199220 -W "ignore:the imp module:DeprecationWarning:gpg.gpgme:15" \
@@ -207,20 +228,20 @@ jobs:
207228 fi
208229 else
209230 # python2 case
210- pytest -v -r a test/ --cov=roundup
231+ pytest -v -r a --durations=20 test/ --cov=roundup
211232 fi
212233
213234 - name : Upload coverage to Codecov
214235 # see: https://github.com/codecov/codecov-action#usage
215- uses : codecov/codecov-action@v3
236+ uses : codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
216237 with :
217238 verbose : true
218239 token : ${{ secrets.CODECOV_TOKEN }}
219240
220241 - name : Upload coverage to Coveralls
221242 # python 2.7 and 3.6 versions of coverage can't produce lcov files.
222243 if : matrix.python-version != '2.7' && matrix.python-version != '3.6'
223- uses : coverallsapp/github-action@master
244+ uses : coverallsapp/github-action@f350da2c033043742f89e8c0b7b5145a1616da6d # master
224245 with :
225246 github-token : ${{ secrets.GITHUB_TOKEN }}
226247 path-to-lcov : coverage.lcov
@@ -247,13 +268,16 @@ jobs:
247268 # -f scripts/Docker/Dockerfile .
248269
249270
250- # in parallel build codecov requires a finish step
271+ # in parallel build coveralls requires a finish step
251272 finish :
252273 needs : test
253274 runs-on : ubuntu-latest
275+
276+ if : " !contains(github.event.head_commit.message, 'no-github-ci')"
277+
254278 steps :
255279 - name : Coveralls Finished
256- uses : coverallsapp/github-action@master
280+ uses : coverallsapp/github-action@f350da2c033043742f89e8c0b7b5145a1616da6d # master
257281 with :
258282 github-token : ${{ secrets.github_token }}
259283 parallel-finished : true
0 commit comments