Skip to content

Commit 04c2609

Browse files
Merge pull request #1211 from nestjs/feature/lighthouse-ci
chore: add lighthouse ci check
2 parents 3952e92 + d6754ef commit 04c2609

File tree

6 files changed

+91
-4
lines changed

6 files changed

+91
-4
lines changed

.github/workflows/lighthouse.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Lighthouse
2+
3+
on:
4+
pull_request:
5+
paths-ignore:
6+
- 'content/**/*.md'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v1
14+
- name: Use Node.js 12.x
15+
uses: actions/setup-node@v1
16+
with:
17+
node-version: 12.x
18+
# Build needs around 400 seconds on Netlify.
19+
# We can not rely on "Waiting for 200", since the user
20+
# might push another commit to an existing PR, meaning
21+
# the deploy preview is already online.
22+
- name: Sleep 400 seconds
23+
run: sleep 400
24+
- name: Waiting for 200 from the Netlify Preview
25+
uses: jakepartusch/wait-for-netlify-action@v1
26+
id: wait-for-netflify-preview
27+
with:
28+
site_name: 'docs-nestjs'
29+
max_timeout: 600
30+
- name: Run Lighthouse on urls and validate with lighthouserc
31+
uses: treosh/lighthouse-ci-action@v2
32+
with:
33+
urls: |
34+
${{ steps.wait-for-netflify-preview.outputs.url }}
35+
${{ steps.wait-for-netflify-preview.outputs.url }}/first-steps
36+
runs: 5
37+
configPath: './lighthouserc.json'
38+
uploadArtifacts: true
39+
temporaryPublicStorage: true

lighthouserc.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"ci": {
3+
"collect": {
4+
"numberOfRuns": 5
5+
},
6+
"assert": {
7+
"assertions": {
8+
"categories:accessibility": [
9+
"error",
10+
{ "minScore": 0.84, "aggregationMethod": "optimistic" }
11+
],
12+
"categories:performance": [
13+
"error",
14+
{ "minScore": 0.4, "aggregationMethod": "optimistic" }
15+
],
16+
"categories:best-practices": [
17+
"error",
18+
{ "minScore": 0.86, "aggregationMethod": "optimistic" }
19+
],
20+
"categories:seo": [
21+
"error",
22+
{ "minScore": 0.67, "aggregationMethod": "optimistic" }
23+
],
24+
"categories:pwa": "off",
25+
26+
"first-contentful-paint": "off",
27+
28+
"canonical": "off",
29+
"label": "off",
30+
31+
"color-contrast": "off"
32+
}
33+
}
34+
}
35+
}

src/app/homepage/footer/footer.component.html

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
<footer>
22
<div class="social-wrapper">
3-
<a href="https://www.facebook.com/kammysliwiec/" target="_blank"
3+
<a
4+
title="Kamil Mysliwiec Facebook"
5+
href="https://www.facebook.com/kammysliwiec/"
6+
target="_blank"
47
><i class="fab fa-facebook"></i
58
></a>
6-
<a href="https://twitter.com/kammysliwiec" target="_blank"
9+
<a
10+
title="Kamil Mysliwiec Twitter"
11+
href="https://twitter.com/kammysliwiec"
12+
target="_blank"
713
><i class="fab fa-twitter"></i
814
></a>
9-
<a href="https://github.com/kamilmysliwiec" target="_blank"
15+
<a
16+
title="Kamil Mysliwiec Github"
17+
href="https://github.com/kamilmysliwiec"
18+
target="_blank"
1019
><i class="fab fa-github"></i
1120
></a>
1221
<a

src/app/homepage/homepage.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
href="https://docs.nestjs.com/"
55
title="Documentation | NestJS - A node.js framework built on top of TypeScript"
66
>
7-
<img src="/assets/logo-small.svg" />
7+
<img alt="NestJS Logo" src="/assets/logo-small.svg" />
88
</a>
99
</div>
1010
</app-header>
@@ -29,6 +29,7 @@ <h4 class="title">Principal Sponsor</h4>
2929
<a href="https://valor-software.com/" target="_blank">
3030
<img
3131
src="/assets/sponsors/valor-software.png"
32+
alt="Valor Logo"
3233
class="logo-sponsor"
3334
/>
3435
</a>

src/app/homepage/newsletter/newsletter.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ <h3>Join our Newsletter</h3>
2828
<button
2929
type="submit"
3030
class="signup-button"
31+
aria-label="Signup to Newsletter"
3132
[disabled]="isDisabled"
3233
[class.btn-success]="isEmailAdded"
3334
>

src/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@
4444

4545
<link rel="icon" type="image/x-icon" href="favicon.ico" />
4646
<link
47+
defer
4748
href="https://fonts.googleapis.com/icon?family=Material+Icons"
4849
rel="stylesheet"
4950
/>
5051
<link
52+
defer
5153
href="https://fonts.googleapis.com/css?family=Inconsolata"
5254
rel="stylesheet"
5355
/>

0 commit comments

Comments
 (0)