1+ name : pull request
2+
3+ on : [pull_request]
4+
5+ permissions :
6+ contents : write
7+ pull-requests : write
8+
9+ jobs :
10+ build :
11+ name : build
12+ runs-on : ubuntu-latest
13+
14+ outputs :
15+ cache_key : ${{ steps.cache_key.outputs.cache_key }}
16+
17+ steps :
18+ - uses : actions/checkout@v3
19+ with :
20+ submodules : recursive
21+ - id : cache_key
22+ run : echo "cache_key=${{ hashFiles('**/**') }}-v1" >> "$GITHUB_OUTPUT"
23+ - uses : actions/cache@v3
24+ id : cache
25+ with :
26+ path : ./app
27+ key : ${{ steps.cache_key.outputs.cache_key }}
28+ - if : steps.cache.outputs.cache-hit != true
29+ uses : actions/setup-node@v3
30+ with :
31+ node-version : 18
32+ - if : steps.cache.outputs.cache-hit != true
33+ run : npm install
34+ working-directory : ./app
35+ - if : steps.cache.outputs.cache-hit != true
36+ env :
37+ ELEVENTY_ENV : production
38+ run : npm run build
39+ working-directory : ./app
40+
41+ pa11y-scan :
42+ runs-on : ubuntu-latest
43+ steps :
44+ - uses : actions/checkout@v3
45+ with :
46+ submodules : recursive
47+ - name : Use Node
48+ uses : actions/setup-node@v3
49+ with :
50+ node-version : ' 18.x'
51+ - name : Install node dependencies
52+ run : npm install
53+ working-directory : ./app
54+ - name : Build site
55+ run : npm run build
56+ working-directory : ./app
57+ - name : Start server in background
58+ run : npx serve dist -l 8080 &
59+ working-directory : ./app
60+ - name : Wait for server
61+ run : sleep 5
62+ - name : Accessibility scan
63+ run : npm run test:pa11y-ci
64+ working-directory : ./app
65+
66+ validate_html :
67+ needs : [build]
68+ name : validate html
69+ runs-on : ubuntu-latest
70+ steps :
71+ - uses : actions/checkout@v3
72+ with :
73+ submodules : recursive
74+ - uses : actions/cache/restore@v3
75+ with :
76+ key : ${{ needs.build.outputs.cache_key }}
77+ path : ./app
78+ - uses : actions/setup-node@v3
79+ with :
80+ node-version : 18
81+ - run : npm run test:html-validation
82+ working-directory : ./app
83+
84+
85+ check_links :
86+ needs : [build]
87+ name : Check all links
88+ runs-on : ubuntu-latest
89+ steps :
90+ - uses : actions/checkout@v3
91+ with :
92+ submodules : recursive
93+ - uses : actions/cache/restore@v3
94+ with :
95+ key : ${{ needs.build.outputs.cache_key }}
96+ path : ./app
97+ - uses : actions/setup-node@v3
98+ with :
99+ node-version : 18
100+ - name : Start server in background
101+ run : npx serve dist -l 8080 &
102+ working-directory : ./app
103+ - name : Wait for server
104+ run : sleep 5
105+ - name : Test all links
106+ run : npm run test:links
107+ working-directory : ./app
108+
109+ lint :
110+ name : Run linter
111+ runs-on : ubuntu-latest
112+ steps :
113+ - uses : actions/checkout@v3
114+ with :
115+ submodules : recursive
116+ - name : Use Node
117+ uses : actions/setup-node@v3
118+ with :
119+ node-version : 18
120+ - name : Install node dependencies
121+ run : npm install
122+ working-directory : ./app
123+ - name : Run eslint
124+ run : npm run lint
125+ working-directory : ./app
0 commit comments