forked from mkdocs/mkdocs
-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (112 loc) · 3.81 KB
/
tox.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: CI
on: [push, pull_request]
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, '3.10', pypy-3.7-v7.x]
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: '3.10'
tox-env: py310
- python-version: pypy-3.7-v7.x
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