Maint #266
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: | |
branches: [ '*' ] | |
pull_request: | |
branches: [ '*' ] | |
jobs: | |
checks: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Checkout working copy | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- name: Install checkers | |
run: | | |
python -mpip install --upgrade pip | |
python -mpip install black flake8 | |
- name: flake | |
run: flake8 . | |
- name: black | |
run: black --check --diff --color --quiet . | |
compile: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "pypy-3.8"] | |
pyyaml-version: ["5.1.*", "5.4.*", "6.0.*", "6.*"] | |
exclude: | |
- python-version: 2.7 | |
pyyaml-version: 6.0.* | |
- python-version: 2.7 | |
pyyaml-version: 6.* | |
steps: | |
- name: Checkout working copy | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependency | |
run: | | |
python -mpip install --upgrade pip | |
python -mpip install pyyaml==${{ matrix.pyyaml-version }} | |
- name: Build regexes.py | |
run: python setup.py build_regexes -i | |
- name: Check results | |
run: | | |
# check that _regexes exists, and .eggs does not (== setuptools used our dependency) | |
test -e ua_parser/_regexes.py -a ! -e .eggs | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "pypy-3.8"] | |
steps: | |
- name: Checkout working copy | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install test dependencies | |
run: | | |
python -mpip install --upgrade pip | |
# if binary wheels are not available for the current package install libyaml | |
# NB: cyaml is outright broken on pypy so exclude that | |
if ! ${{matrix.python-version == 'pypy-3.8'}}; then | |
if ! pip download --only-binary pyyaml -rrequirements_dev.txt > /dev/null 2>&1; then | |
sudo apt install libyaml-dev | |
fi | |
fi | |
python -mpip install -r requirements_dev.txt | |
- name: install package in environment | |
run: python setup.py develop | |
- name: run tests | |
run: pytest -v -Werror | |
- name: run doctests | |
# pprint formatting was changed a lot in 3.5 | |
if: ${{ matrix.python-version != '2.7' }} | |
run: python -mdoctest README.rst |