Skip to content

Commit

Permalink
5 lighthouse action (#30)
Browse files Browse the repository at this point in the history
* #5 lighthouse github action

* #5 changed node version

* #5 change base url (test running against index.html)

* #5 fixed base url for lighthouse

* #5 audit lighthouse action

* #5 update github action

* #5 lighthouse audit checks

* update scores thresholds
  • Loading branch information
RossellaFer authored Apr 26, 2024
1 parent e964193 commit 96f7f03
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
'plugin:react/recommended',
'plugin:react/jsx-runtime'
],
ignorePatterns: ['dist', '.eslintrc.cjs', '*.html'],
ignorePatterns: ['dist', '.eslintrc.cjs', 'lighthouserc.cjs', '*.html'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: ["tsconfig.json", "tsconfig.node.json"]
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/lighthouse-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: CI
on: [push]
jobs:
lighthouseci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm install && npm install -g @lhci/[email protected]
- run: npm run build
- run: lhci autorun
21 changes: 21 additions & 0 deletions lighthouserc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
ci: {
upload: {
target: 'temporary-public-storage',
},
collect: {
staticDistDir: './dist',
"url": [
"http://localhost/"
]
},
assert: {
assertions: {
'categories:accessibility': ["error", { minScore: 0.9 }],
'categories:best-practices': ["warn", { minScore: 0.8 }],
"categories:performance": ["error", {"minScore": 0.8}],
'categories:seo': ["error", { minScore: 0.9 }],
},
},
},
};

0 comments on commit 96f7f03

Please sign in to comment.