Files
mkdocs/.github/workflows/tox.yml
2022-10-03 19:30:02 +02:00

111 lines
3.2 KiB
YAML

name: CI
on: [push, pull_request]
jobs:
test:
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9, '3.10', pypy-3.7-v7.x]
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- python-version: 3.7
tox-env: py37
- python-version: 3.8
tox-env: py38
- python-version: 3.9
tox-env: py39
- python-version: '3.10'
tox-env: py310
- python-version: pypy-3.7-v7.x
tox-env: pypy3
# Just to slim down the test matrix:
exclude:
- python-version: 3.8
os: macos-latest
- python-version: 3.8
os: windows-latest
- python-version: 3.9
os: ubuntu-latest
env:
TOXENV: ${{ matrix.tox-env }}-{unittests,min-req,integration,integration-no-babel}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip tox
- name: Run tox
run: |
python -m tox --discover $(which python)
shell: bash
- name: Upload Codecov Results
if: success()
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
flags: unittests
name: ${{ matrix.os }}/${{ matrix.tox-env }}
fail_ci_if_error: false
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip tox
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 16
- name: Check with isort
if: always()
run: python -m tox -e isort && git diff --exit-code
- name: Check with black
if: always()
run: python -m tox -e black && git diff --exit-code
- name: Check with flake8
if: always()
run: python -m tox -e flake8
- name: Check with mypy
if: always()
run: python -m tox -e mypy
- name: Check with markdown-lint
if: always()
run: python -m tox -e markdown-lint
- name: Check with jshint
if: always()
run: python -m tox -e jshint
- name: Check with csslint
if: always()
run: python -m tox -e csslint
- name: Check with codespell
if: always()
run: python -m tox -e codespell
translation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install Python dependencies
run: |
python -m pip install babel
- name: Compile localization message files
run: |
pybabel compile --statistics --directory mkdocs/themes/mkdocs/locales
pybabel compile --statistics --directory mkdocs/themes/readthedocs/locales