Skip to content

trim Python2 <-> 3 hybridation #288

trim Python2 <-> 3 hybridation

trim Python2 <-> 3 hybridation #288

name: Build and test
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python-version:
- 3.8
- 3.9
- '3.10'
- 3.11
- 3.12
# As per https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md#pypy list of versions
- pypy-3.8
- pypy-3.9
- pypy-3.10
astroid-version:
- ''
include:
# Test recent Python on Astroid v2 too (the above natural tests will
# pick up Astroid v3 for these Python versions)
- python-version: '3.8'
astroid-version: '<3'
- python-version: '3.9'
astroid-version: '<3'
- python-version: '3.10'
astroid-version: '<3'
- python-version: '3.11'
astroid-version: '<3'
- python-version: '3.12'
astroid-version: '<3'
- python-version: 'pypy-3.10'
astroid-version: '<3'
env:
COVERALLS_PARALLEL: true
steps:
- uses: actions/checkout@v3
- 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: Install dependencies
run: |
pip install --upgrade coveralls pytest setuptools setuptools_scm pep517
pip install .[test] 'astroid${{ matrix.astroid-version }}'
- name: Mypy testing
run: |
# Not an exact mypy version, as we need 0.942 for pypy-3.8 support, but it's not available on 3.5
pip install types-six "mypy>=0.910,<=0.942"
python -m mypy asttokens tests/*.py
- name: Fast tests with coverage
run: |
pytest --cov -n auto -m "not slow"
coverage report -m
- name: Slow tests without coverage
run: |
pytest -n auto -m slow
- name: Collect coverage results
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pip3 install --upgrade coveralls
python3 -m coveralls --service=github
finish:
needs: test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@v20201129
with:
parallel-finished: true