mirror of
https://github.com/mkdocs/mkdocs.git
synced 2026-03-27 09:58:31 +07:00
123 lines
3.8 KiB
YAML
123 lines
3.8 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
tags:
|
|
- '**'
|
|
pull_request:
|
|
branches:
|
|
- '**'
|
|
|
|
jobs:
|
|
test:
|
|
strategy:
|
|
fail-fast: false
|
|
max-parallel: 4
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
python-version: [3.6, 3.7, 3.8, 3.9, pypy3]
|
|
include:
|
|
- python-version: 3.6
|
|
tox-env: py36
|
|
- python-version: 3.7
|
|
tox-env: py37
|
|
- python-version: 3.8
|
|
tox-env: py38
|
|
- python-version: 3.9
|
|
tox-env: py39
|
|
- python-version: pypy3
|
|
tox-env: pypy3
|
|
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 coverage codecov
|
|
- 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.9
|
|
- name: Install Python dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip tox
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 14
|
|
- name: Install Node dependencies
|
|
run: |
|
|
npm install -g markdownlint-cli jshint csslint
|
|
- name: Check with flake8
|
|
if: always()
|
|
run: python -m tox -e flake8
|
|
- 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 ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.7
|
|
- name: Install Python dependencies
|
|
run: |
|
|
python -m pip install -r requirements/project.txt
|
|
- name: Check if Portable Object Templates should have been updated
|
|
run: |
|
|
python setup.py extract_messages -t mkdocs
|
|
python setup.py extract_messages -t readthedocs
|
|
git diff -G "msgid" --exit-code mkdocs/themes/*/*.pot
|
|
shell: bash
|
|
- id: files
|
|
uses: jitterbit/get-changed-files@v1
|
|
- name: Check if Portable Object translation files should be updated on mkdocs version change
|
|
run: |
|
|
for locale in $(ls mkdocs/themes/mkdocs/locales/); do python setup.py update_catalog -t mkdocs -l ${locale}; done
|
|
for locale in $(ls mkdocs/themes/readthedocs/locales/); do python setup.py update_catalog -t readthedocs -l ${locale}; done
|
|
for changed_file in ${{ steps.files.outputs.all }}; do
|
|
# echo "inspecting changed file: ${changed_file}";
|
|
if [[ "${changed_file}" == "mkdocs/__init__.py" ]]; then
|
|
# echo "mkdocs version changed!";
|
|
git diff -G "msgid" --exit-code || exit 1
|
|
git diff -G "msgstr" --exit-code || exit 2
|
|
fi
|
|
done
|
|
shell: bash
|