@@ -29,13 +29,12 @@ jobs:
29
29
python -m pip install --upgrade pip
30
30
python -m pip install --upgrade pre-commit
31
31
pip install -e .
32
- yarn install
32
+ yarn
33
33
34
34
- name : Lint
35
35
run : |
36
36
pre-commit run --all-files
37
37
38
-
39
38
# Build docs on a number of Python versions. In the future this can be
40
39
# where tests go.
41
40
tests :
63
62
export PATH="$HOME/miniconda/bin:$PATH"
64
63
sphinx-build -b html docs/ docs/_build/html -W --keep-going
65
64
65
+ # Run local Lighthouse audit against built site
66
+ audit :
67
+
68
+ runs-on : ubuntu-latest
69
+ strategy :
70
+ matrix :
71
+ python-version : [3.8]
72
+ env :
73
+ PORT : 8000
74
+ # the host interface to listen on, might need to be 0.0.0.0
75
+ HOST : 127.0.0.1
76
+ # the base url
77
+ URL : http://127.0.0.1:8000
78
+
79
+ steps :
80
+ - uses : actions/checkout@v2
81
+ - name : Set up Python ${{ matrix.python-version }}
82
+ uses : actions/setup-python@v1
83
+ with :
84
+ python-version : ${{ matrix.python-version }}
85
+ - name : Install dependencies
86
+ run : |
87
+ python -m pip install --upgrade pip
88
+ pip install -e .
89
+ pip install -r docs/requirements.txt
90
+
91
+ # Build the docs
92
+ - name : Build docs to store
93
+ run : |
94
+ export PATH="$HOME/miniconda/bin:$PATH"
95
+ sphinx-build -b html docs/ docs/_build/html -W --keep-going
96
+
97
+ # Serve the docs and wait to be ready
98
+ - name : Serve the built site
99
+ run : |
100
+ nohup python docs/serve.py --port=${PORT} --host=${HOST} &
101
+ curl --retry 10 --retry-connrefused --retry-max-time 60 ${URL}/index.html
102
+
103
+ # Run the audit
104
+ # TODO: use the hosted API with a secret? would allow for comparison over time...
105
+ - name : Make folder for Lighthouse reports
106
+ run : mkdir -p /tmp/lighthouse/lighthouse-${{ github.run_number }}
107
+ - name : Run Lighthouse on Site
108
+ id : lighthouse
109
+ uses :
foo-software/[email protected]
110
+ with :
111
+ # TODO: generate this list to audit all html pages
112
+ urls : >-
113
+ ${{ env.URL }}/index.html,
114
+ ${{ env.URL }}/demo/api.html,
115
+ ${{ env.URL }}/demo/demo.html,
116
+ ${{ env.URL }}/demo/example_pandas.html
117
+ outputDirectory : /tmp/lighthouse/lighthouse-${{ github.run_number }}
118
+ verbose : true
119
+
120
+ # Store the audit
121
+ - name : Upload Lighthouse Reports
122
+ uses : actions/upload-artifact@v2
123
+ with :
124
+ name : Lighthouse Report ${{ github.run_number }}
125
+ path : /tmp/lighthouse
126
+
127
+ # Check the audit for threshold values
128
+ # TODO: write this someplace after a PR is merged, and load?
129
+ - name : Assess Lighthouse Check results
130
+ uses :
foo-software/[email protected]
131
+ with :
132
+ lighthouseCheckResults : ${{ steps.lighthouse.outputs.lighthouseCheckResults }}
133
+ minAccessibilityScore : " 96"
134
+ minBestPracticesScore : " 90"
135
+ minPerformanceScore : " 10"
136
+ minSeoScore : " 80"
137
+
66
138
publish :
67
139
68
140
name : Publish to PyPi
0 commit comments