-
-
Notifications
You must be signed in to change notification settings - Fork 182
66 lines (66 loc) · 2.33 KB
/
test_website.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
######################################
## Custom Web Almanac GitHub action ##
######################################
#
# This generates the chapters and tests the website when a pull request is
# opened (or added to) on the original repo
#
name: Test Website
on:
workflow_dispatch:
pull_request:
paths-ignore:
- 'sql/**'
push:
branches:
- main
jobs:
build:
name: Build and Test Website
runs-on: ubuntu-20.04
if: github.repository == 'HTTPArchive/almanac.httparchive.org'
steps:
- name: Checkout branch
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
- name: Setup Node.js for use with actions
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Set up Python 3.12
uses: actions/[email protected]
with:
python-version: '3.12'
- name: Run the website
run: ./src/tools/scripts/run_and_test_website.sh
- name: Remove node modules to avoid linting errors
run: rm -rf src/node_modules
- name: Use more complete checks for generated HTML linting
run: cp -f .github/linters/.htmlhintrc_morechecks .github/linters/.htmlhintrc
- name: Lint Generated HTML
uses: github/super-linter/[email protected]
env:
DEFAULT_BRANCH: main
FILTER_REGEX_INCLUDE: src/static/html/.*
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_HTML: true
USE_FIND_ALGORITHM: true
- name: Set the list of URLs for Lighthouse to check
env:
RUN_TYPE: ${{ github.event_name }}
COMMIT_SHA: ${{ github.sha }}
run: ./src/tools/scripts/set_lighthouse_urls.sh
- name: Audit URLs using Lighthouse
uses: treosh/[email protected]
id: LHCIAction
with:
# For dev, turn off all timing perf audits (too unreliable) and a few others that don't work on dev
configPath: .github/lighthouse/lighthouse-config-dev.json
uploadArtifacts: true # save results as an action artifacts
temporaryPublicStorage: true # upload lighthouse report to the temporary storage
- name: Show Lighthouse outputs
run: |
# All results by URL:
echo '${{ steps.LHCIAction.outputs.manifest }}' | jq -r '.[] | (.summary|tostring) + " - " + .url'