CI: use system Python 2.7. #101
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: | |
main: | |
strategy: | |
matrix: | |
include: | |
- python: '2.7' | |
cython: cython==0.28 | |
- python: '2.7' | |
os: ubuntu-20.04 | |
- python: '3.5' | |
os: ubuntu-20.04 | |
cython: cython==0.28 | |
- 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-dev' | |
os: ubuntu-22.04 | |
runs-on: ${{matrix.os}} | |
steps: | |
- uses: actions/checkout@v3 | |
- 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@v4 | |
with: | |
python-version: ${{matrix.python}} | |
- name: set up APT | |
if: matrix.python == '2.7' | |
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: matrix.python == '2.7' | |
run: | | |
sudo apt-get install -y python-is-python2 | |
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py | |
sudo python get-pip.py | |
rm get-pip.py | |
- name: upgrade TLS stack | |
if: matrix.python == '2.7' | |
run: | | |
sudo apt-get install --only-upgrade -y ca-certificates libgnutls30 | |
- name: install setuptools (if distutils is missing) | |
if: env.pythonLocation | |
run: | | |
if ! [ -d ${{env.pythonLocation}}/lib/python*/distutils/ ]; then | |
python -m pip install setuptools | |
fi | |
- name: set up pip cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: pip-${{matrix.os}}-python${{matrix.python}}-${{matrix.cython || 'cython'}} | |
- name: build and install AFL | |
run: | | |
mkdir deps | |
wget https://lcamtuf.coredump.cx/afl/releases/afl-latest.tgz -O deps/afl.tar.gz | |
tar -xvzf deps/afl.tar.gz -C deps/ | |
make -C deps/afl-*/ install PREFIX=~/.local | |
- name: install Cython | |
run: | |
python -m pip install --verbose ${{matrix.cython || 'cython'}} | |
- name: setup.py build | |
run: | |
PYTHONWARNINGS=error::FutureWarning python setup.py build | |
- name: setup.py install | |
run: | |
python setup.py install | |
- name: run tests | |
run: | | |
python -m pip install pytest | |
python -m pytest --verbose | |
- name: run pycodestyle | |
run: | | |
pip install pycodestyle | |
pycodestyle . | |
continue-on-error: | |
${{ endsWith(matrix.python, '-dev') }} | |
# FIXME: ./afl.pyx:196:121: E501 line too long (172 > 120 characters) | |
# https://github.com/PyCQA/pycodestyle/issues/1142 | |
- name: run pydiatra | |
run: | | |
python -m pip install pydiatra | |
python -m pydiatra -v . | |
- name: run pyflakes | |
run: | | |
python -m pip install pyflakes | |
python -m pyflakes . | |
- name: run pylint | |
run: | | |
pip install pylint | |
private/run-pylint | |
- name: check changelog syntax | |
run: | |
dpkg-parsechangelog -ldoc/changelog --all 2>&1 >/dev/null | { ! grep .; } | |
- name: check reST syntax | |
run: | | |
pip install docutils pygments | |
private/check-rst | |
- name: run shellcheck | |
if: matrix.python != '2.7' | |
run: | | |
shellcheck py-afl-* | |
# vim:ts=2 sts=2 sw=2 et |