forked from mkdocs/mkdocs
-
Notifications
You must be signed in to change notification settings - Fork 0
132 lines (128 loc) · 4.22 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
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 the locales are supported by lunr.js
run: |
for locale in $(ls mkdocs/themes/mkdocs/locales/); do
if [[ "${locale}" != "en" ]]; then
if [[ ! -f "mkdocs/contrib/search/lunr-language/lunr.${locale}.js" ]]; then
echo "WARNING: locale '${locale}' is not supported by lunr.js"
fi
fi
done
shell: bash
- 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