@@ -2,6 +2,9 @@ name: continuous-integration
2
2
3
3
on : [push, pull_request]
4
4
5
+ env :
6
+ COVERAGE_THRESHOLD : 62
7
+
5
8
jobs :
6
9
7
10
lint :
@@ -24,12 +27,29 @@ jobs:
24
27
with :
25
28
node-version : ' 10.x'
26
29
30
+ - name : Cache python wheels
31
+ uses : actions/cache@v2
32
+ with :
33
+ path : ~/.cache/pip
34
+ key : |
35
+ ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py', 'docs/requirements.txt') }}
36
+ restore-keys : |
37
+ ${{ runner.os }}-pip-${{ matrix.python-version }}-
38
+ ${{ runner.os }}-pip-
39
+
40
+ - name : Cache node_modules
41
+ uses : actions/cache@v2
42
+ with :
43
+ path : ' node_modules'
44
+ key : |
45
+ ${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock') }}
46
+
27
47
- name : Install dependencies
28
48
run : |
29
- python -m pip install --upgrade pip
49
+ python -m pip install --upgrade pip setuptools wheel
30
50
python -m pip install --upgrade pre-commit
31
- pip install -e .
32
- yarn
51
+ python -m pip install -e .
52
+ yarn --frozen-lockfile
33
53
34
54
- name : Lint
35
55
run : |
@@ -50,21 +70,35 @@ jobs:
50
70
uses : actions/setup-python@v1
51
71
with :
52
72
python-version : ${{ matrix.python-version }}
73
+
74
+ - name : Cache python wheels
75
+ uses : actions/cache@v2
76
+ with :
77
+ path : ~/.cache/pip
78
+ key : |
79
+ ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py', 'docs/requirements.txt') }}
80
+ restore-keys : |
81
+ ${{ runner.os }}-pip-${{ matrix.python-version }}-
82
+ ${{ runner.os }}-pip-
83
+
53
84
- name : Install dependencies
54
85
run : |
55
- python -m pip install --upgrade pip
56
- pip install -e .
57
- pip install -r docs/requirements.txt
86
+ python -m pip install --upgrade pip setuptools wheel
87
+ python -m pip install -e .[coverage]
58
88
59
89
# Build the docs
60
90
- name : Build docs to store
61
91
run : |
62
92
export PATH="$HOME/miniconda/bin:$PATH"
63
93
sphinx-build -b html docs/ docs/_build/html -W --keep-going
64
94
65
- # Run tests
95
+ # Run tests under coverage
66
96
- name : Run the tests
67
- run : pytest
97
+ run : pytest --cov pydata_sphinx_theme --cov-report term-missing:skip-covered --cov-fail-under ${{ env.COVERAGE_THRESHOLD }}
98
+
99
+ - name : Upload coverage
100
+ if : ${{ always() }}
101
+ run : codecov
68
102
69
103
# Run local Lighthouse audit against built site
70
104
audit :
@@ -86,11 +120,21 @@ jobs:
86
120
uses : actions/setup-python@v1
87
121
with :
88
122
python-version : ${{ matrix.python-version }}
123
+
124
+ - name : Cache python wheels
125
+ uses : actions/cache@v2
126
+ with :
127
+ path : ~/.cache/pip
128
+ key : |
129
+ ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py', 'docs/requirements.txt') }}
130
+ restore-keys : |
131
+ ${{ runner.os }}-pip-${{ matrix.python-version }}-
132
+ ${{ runner.os }}-pip-
133
+
89
134
- name : Install dependencies
90
135
run : |
91
- python -m pip install --upgrade pip
92
- pip install -e .
93
- pip install -r docs/requirements.txt
136
+ python -m pip install --upgrade pip wheel setuptools
137
+ python -m pip install -e .[coverage]
94
138
95
139
# Build the docs
96
140
- name : Build docs to store
@@ -154,7 +198,7 @@ jobs:
154
198
python-version : 3.7
155
199
- name : Build package
156
200
run : |
157
- pip install wheel
201
+ python -m pip install -U pip setuptools wheel
158
202
python setup.py sdist bdist_wheel
159
203
- name : Publish
160
204
0 commit comments