forked from qiuxiang/tuner
-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (107 loc) · 3.13 KB
/
ci.yml
File metadata and controls
114 lines (107 loc) · 3.13 KB
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
name: CI
on:
push:
branches: [ "master", "develop" ]
pull_request:
branches: [ "master", "develop" ]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
- run: npm ci
- name: Run Markdown Lint
run: npm run lint
commit-lint:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
- run: npm ci
- name: Validate current commit (last commit)
if: github.event.pull_request.commits == 1
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~1 --to ${{ github.event.pull_request.head.sha }} --verbose
- name: Validate PR commits
if: github.event.pull_request.commits > 1
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.114.0'
extended: true
- name: Build
run: |
cd stringtune
hugo --minify
quality-checks:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.114.0'
extended: true
- name: Build Site
run: |
cd stringtune
hugo --minify
- name: Lighthouse CI
uses: treosh/lighthouse-ci-action@v10
with:
urls: |
http://localhost:5000/
configPath: './.lighthouserc.json'
# We need to serve the site first. lhci action can do this with 'staticDistDir' but we are in a monorepo-ish structure.
# Let's try staticDistDir pointing to the public folder.
uploadArtifacts: true
temporaryPublicStorage: true
budgetPath: ./budget.json # Optional
a11y:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.114.0'
extended: true
- name: Build Site
run: |
cd stringtune
hugo --minify
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install pa11y-ci
run: npm install -g pa11y-ci http-server
- name: Run Accessibility Checks
run: |
npx http-server stringtune/public -p 8080 &
sleep 5
pa11y-ci --sitemap http://localhost:8080/sitemap.xml