Merge pull request #25 from cpcloud/ipython-8-17 #14
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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: CI | |
on: | |
pull_request: | |
push: | |
branches: master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['2.7', '3.x'] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python ${{ matrix.python-version }} | |
if: matrix.python-version != '2.7' | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set up Python 2 | |
if: matrix.python-version == '2.7' | |
run: | | |
sudo rm -f $(which python) $(which pip) | |
sudo apt-get install python2.7-dev | |
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py | |
python2.7 get-pip.py | |
sudo ln -sf "$(which python2.7)" "$(dirname $(which python2.7))/python" | |
- name: Install dependencies | |
run: | | |
pip install -U pip setuptools wheel | |
pip install pytest flake8 'mock ; python_version < "3"' -e . | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
- name: Test with pytest | |
run: | | |
pytest -s --strict -vv --cache-clear --maxfail=1 |