Skip to content

Commit

Permalink
#5 lighthouse audit checks
Browse files Browse the repository at this point in the history
  • Loading branch information
RossellaFer committed Apr 25, 2024
1 parent c06e008 commit d43d78b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 14 deletions.
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
23 changes: 10 additions & 13 deletions .github/workflows/lighthouse-ci.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
name: Audit live site
on: push

name: CI
on: [push]
jobs:
audit:
lighthouseci:
runs-on: ubuntu-latest
steps:
- name: Audit live URL
uses: jakejarvis/lighthouse-action@master
with:
url: 'https://womeninsoftware.jp/'
- name: Upload results as an artifact
uses: actions/upload-artifact@master
with:
name: report
path: './report'
- 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/"
]
},
asserts: {
assertions: {
'categories:accessibility': ['warn', { minScore: 1 }],
'categories:best-practices': ['warn', { minScore: 1.0 }],
'categories:performance': ['warn', { minScore: 0.2 }],
'categories:seo': ['warn', { minScore: 1.0 }],
},
},
},
};

0 comments on commit d43d78b

Please sign in to comment.