CI: build nose wheel in a separate job. #171
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
- push | |
- pull_request | |
jobs: | |
nose: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: set up Python 3.6 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.6 | |
- name: pip install wheel | |
run: | | |
python3 -m pip install wheel | |
- name: build wheel | |
run: | | |
python3 -m pip wheel --no-binary ':all:' nose | |
- name: upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nose | |
path: nose-*.whl | |
compression-level: 0 | |
retention-days: 1 | |
main: | |
strategy: | |
matrix: | |
include: | |
- python: '2.7' | |
os: ubuntu-20.04 | |
- python: '3.6' | |
os: ubuntu-20.04 | |
- python: '3.7' | |
os: ubuntu-20.04 | |
- python: '3.8' | |
os: ubuntu-20.04 | |
- python: '3.9' | |
os: ubuntu-20.04 | |
- python: '3.10' | |
os: ubuntu-22.04 | |
- python: '3.11' | |
os: ubuntu-22.04 | |
- python: '3.12' | |
os: ubuntu-22.04 | |
- python: '3.13' | |
os: ubuntu-24.04 | |
runs-on: ${{matrix.os}} | |
needs: nose | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set up PATH | |
run: | | |
PATH+=:~/.local/bin | |
echo "$PATH" >> $GITHUB_PATH | |
- name: set up Python ${{matrix.python}} | |
if: matrix.python != 2.7 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{matrix.python}} | |
- name: set up APT | |
if: ${{ ! env.pythonLocation }} | |
run: | | |
printf 'Apt::Install-Recommends "false";\n' | sudo tee -a /etc/apt/apt.conf | |
sudo apt-get update | |
- name: set up Python 2.7 (with APT + get-pip) | |
if: ${{ ! env.pythonLocation }} | |
run: | | |
sudo apt-get install -y python-is-python2 | |
wget https://bootstrap.pypa.io/pip/2.7/get-pip.py | |
sudo python get-pip.py | |
rm get-pip.py | |
- name: set up distutils | |
if: env.pythonLocation | |
run: | | |
if ! [ -d ${{env.pythonLocation}}/lib/python*/distutils/ ]; then | |
python -m pip install setuptools | |
echo SETUPTOOLS_USE_DISTUTILS=local | tee -a $GITHUB_ENV; | |
fi | |
- name: set up pip | |
if: env.pythonLocation | |
run: | | |
sed -i -e 's/ sys.exit(.*)/ raise/' ${{env.pythonLocation}}/lib/python*/site-packages/pip/_internal/utils/setuptools_build.py | |
python -m pip list | |
- name: install deps | |
run: | | |
python -m pip install "futures; python_version < '3'" | |
python -m pip install docutils | |
- name: build | |
run: | |
python setup.py build | |
- name: check docs | |
run: | | |
dpkg-parsechangelog -ldoc/changelog --all 2>&1 >/dev/null | { ! grep .; } | |
private/check-rst | |
- name: download nose | |
if: env.pythonLocation | |
uses: actions/download-artifact@v4 | |
with: | |
name: nose | |
- name: install nose | |
if: env.pythonLocation | |
run: | | |
python -m pip install nose-*.whl | |
# work-around for <https://github.com/nose-devs/nose/issues/1116>: | |
sed -i -e 's/ from unittest import _TextTestResult$/ from unittest import TextTestResult as _TextTestResult/' ${{env.pythonLocation}}/lib/python*/site-packages/nose/result.py | |
if ! python -c 'import imp'; then | |
python -m pip install zombie-imp | |
fi | |
- name: install nose | |
if: ${{ ! env.pythonLocation }} | |
run: | | |
python -m pip install nose | |
- name: run tests | |
run: | | |
python tests/run-tests -v | |
- name: check test coverage | |
run: | | |
private/update-coverage | |
git diff --exit-code | |
- name: install | |
run: | |
python setup.py install --user | |
- name: check whether the module is installed correctly | |
run: | | |
cd / | |
python -m pydiatra --version | |
- name: check whether the executable is installed correctly | |
run: | | |
cd / | |
pyXdiatra=py${pyver%.*}diatra | |
$pyXdiatra --version | |
env: | |
pyver: ${{matrix.python}} | |
- name: APT install man-db | |
if: ${{ ! env.pythonLocation }} | |
run: | | |
sudo apt-get install -y man-db | |
- name: check whether the manual pages are installed correctly | |
run: | | |
export MATHPATH=~/.local/share/man | |
cd / | |
man 1 pydiatra | grep -A 15 -w PYDIATRA | |
pyXdiatra=py${pyver%.*}diatra | |
man 1 $pyXdiatra | grep -A 15 -w PYDIATRA | |
env: | |
pyver: ${{matrix.python}} | |
continue-on-error: | |
${{ (env.SETUPTOOLS_USE_DISTUTILS && true) || false }} | |
# FIXME: "No manual entry for pydiatra in section 1" | |
- name: install with pip | |
run: | | |
rm -rvf ~/.local/lib/python*/site-packages/pydiatra* | |
python -m pip install . | |
- name: run pydiatra | |
run: | | |
PYTHON=python private/run-pydiatra | |
- name: run pyflakes | |
run: | | |
python -m pip install pyflakes | |
PYTHON=python private/run-pyflakes | |
- name: run pylint | |
run: | | |
python -m pip install pylint | |
PYTHON=python private/run-pylint | |
windows: | |
strategy: | |
matrix: | |
include: | |
- python: '3.4' | |
os: windows-2019 | |
- python: '3.9' | |
os: windows-2019 | |
- python: '3.11' | |
os: windows-2019 | |
runs-on: ${{matrix.os}} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set up Python ${{matrix.python}} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{matrix.python}} | |
- name: install deps | |
run: | | |
python -m pip install "futures; python_version < '3'" | |
python -m pip install docutils | |
- name: build | |
run: | |
python setup.py build | |
- name: remove CRs from test files | |
run: | | |
sed -i -e 's/\r$//' tests/*.t | |
- name: run tests | |
run: | | |
# work-around for <https://github.com/nose-devs/nose/issues/1115>: | |
python -m pip install --upgrade 'setuptools<58' | |
python -m pip install --upgrade 'wheel<0.38' | |
# work-around for <https://github.com/nose-devs/nose/issues/1099>: | |
no_build_isolation=$(python -m pip install --help | grep -oF ' --no-build-isolation ' || true) | |
python -m pip install $no_build_isolation --no-binary ':all:' nose | |
python tests/run-tests -v | |
shell: bash | |
# vim:ts=2 sts=2 sw=2 et |