| name: Tests |
| |
| on: |
| push: |
| branches: [master, 'release*'] |
| tags: ['*'] |
| pull_request: |
| paths-ignore: |
| - 'docs/**' |
| - '**/*.rst' |
| - '**/*.md' |
| - .gitignore |
| - CREDITS |
| - LICENSE |
| |
| jobs: |
| main: |
| runs-on: ${{ matrix.os }} |
| strategy: |
| fail-fast: false |
| matrix: |
| include: |
| - name: Test suite with py37-windows-32 |
| python: '3.7' |
| arch: x86 |
| os: windows-latest |
| toxenv: py37 |
| - name: Test suite with py37-windows-64 |
| python: '3.7' |
| arch: x64 |
| os: windows-latest |
| toxenv: py37 |
| - name: Test suite with py37-ubuntu |
| python: '3.7' |
| arch: x64 |
| os: ubuntu-latest |
| toxenv: py |
| tox_extra_args: "-n 2" |
| - name: Test suite with py38-ubuntu |
| python: '3.8' |
| arch: x64 |
| os: ubuntu-latest |
| toxenv: py |
| tox_extra_args: "-n 2" |
| - name: Test suite with py36-ubuntu, mypyc-compiled |
| python: '3.6' |
| arch: x64 |
| os: ubuntu-latest |
| toxenv: py |
| tox_extra_args: "-n 2" |
| test_mypyc: true |
| - name: Test suite with py39-ubuntu, mypyc-compiled |
| python: '3.9' |
| arch: x64 |
| os: ubuntu-latest |
| toxenv: py |
| tox_extra_args: "-n 2" |
| test_mypyc: true |
| - name: Test suite with py310-ubuntu |
| python: '3.10' |
| arch: x64 |
| os: ubuntu-latest |
| toxenv: py |
| tox_extra_args: "-n 2" |
| - name: mypyc runtime tests with py36-macos |
| python: '3.6' |
| arch: x64 |
| os: macos-latest |
| toxenv: py |
| tox_extra_args: "-n 2 mypyc/test/test_run.py mypyc/test/test_external.py" |
| - name: mypyc runtime tests with py36-debug-build-ubuntu |
| python: '3.6.8' |
| arch: x64 |
| os: ubuntu-latest |
| toxenv: py36 |
| tox_extra_args: "-n 2 mypyc/test/test_run.py mypyc/test/test_external.py" |
| debug_build: true |
| - name: Type check our own code (py37-ubuntu) |
| python: '3.7' |
| arch: x64 |
| os: ubuntu-latest |
| toxenv: type |
| - name: Type check our own code (py37-windows-64) |
| python: '3.7' |
| arch: x64 |
| os: windows-latest |
| toxenv: type |
| - name: Code style with flake8 |
| python: '3.7' |
| arch: x64 |
| os: ubuntu-latest |
| toxenv: lint |
| |
| name: ${{ matrix.name }} |
| steps: |
| - uses: actions/checkout@v2 |
| - uses: actions/setup-python@v2 |
| with: |
| python-version: ${{ matrix.python }} |
| architecture: ${{ matrix.arch }} |
| - name: Debug build |
| if: ${{ matrix.debug_build }} |
| run: | |
| PYTHONVERSION=${{ matrix.python }} |
| PYTHONDIR=~/python-debug/python-$PYTHONVERSION |
| VENV=$PYTHONDIR/env |
| ./misc/build-debug-python.sh $PYTHONVERSION $PYTHONDIR $VENV |
| source $VENV/bin/activate |
| - name: Install tox |
| run: pip install --upgrade 'setuptools!=50' 'virtualenv>=20.6.0' tox==3.20.1 |
| - name: Compiled with mypyc |
| if: ${{ matrix.test_mypyc }} |
| run: | |
| pip install -r test-requirements.txt |
| CC=clang MYPYC_OPT_LEVEL=0 python3 setup.py --use-mypyc build_ext --inplace |
| - name: Setup tox environment |
| run: tox -e ${{ matrix.toxenv }} --notest |
| - name: Test |
| run: tox -e ${{ matrix.toxenv }} --skip-pkg-install -- ${{ matrix.tox_extra_args }} |
| |
| # TODO: re-enable when `typed-ast` will be fixed for `python==3.11` |
| # python-nightly: |
| # runs-on: ubuntu-latest |
| # name: Test suite with Python nightly |
| # steps: |
| # - uses: actions/checkout@v2 |
| # - uses: actions/setup-python@v2 |
| # with: |
| # python-version: '3.11-dev' |
| # - name: Install tox |
| # run: | |
| # pip install -U pip==21.2.3 setuptools |
| # pip install --upgrade 'setuptools!=50' virtualenv==20.4.7 tox==3.20.1 |
| # - name: Setup tox environment |
| # run: tox -e py --notest |
| # - name: Test |
| # run: tox -e py --skip-pkg-install -- "-n 2" |
| # continue-on-error: true |
| # - name: Mark as a success |
| # run: exit 0 |