mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 06:03:38 +08:00
test: Update lighthouse-ci.yml (#24598)
* Update lighthouse-ci.yml * Create lighthouserc.js * Update index.js * Add url * fix url * fix assertions
This commit is contained in:
parent
bd9b38527e
commit
31fa14a742
29
.github/workflows/lighthouse-ci.yml
vendored
29
.github/workflows/lighthouse-ci.yml
vendored
@ -1,24 +1,11 @@
|
||||
name: Lighthouse Check
|
||||
on: [pull_request]
|
||||
|
||||
name: CI
|
||||
on: [push]
|
||||
jobs:
|
||||
lighthouse-check:
|
||||
lighthouseci:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- run: mkdir /tmp/artifacts
|
||||
- name: Run Lighthouse
|
||||
uses: foo-software/lighthouse-check-action@master
|
||||
id: lighthouseCheck
|
||||
with:
|
||||
accessToken: ${{ secrets.GITHUB_TOKEN }}
|
||||
outputDirectory: /tmp/artifacts
|
||||
emulatedFormFactor: desktop
|
||||
timeout: 1200
|
||||
prCommentEnabled: false
|
||||
urls: 'https://preview-${{ github.event.pull_request.number }}-ant-design.surge.sh,https://preview-${{ github.event.pull_request.number }}-ant-design.surge.sh/components/button'
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@master
|
||||
with:
|
||||
name: Lighthouse reports
|
||||
path: /tmp/artifacts
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
- run: npm install && npm install -g @lhci/cli@0.4.x
|
||||
- run: npm run site
|
||||
- run: lhci autorun --upload.target=temporary-public-storage
|
||||
|
19
lighthouserc.js
Normal file
19
lighthouserc.js
Normal file
@ -0,0 +1,19 @@
|
||||
module.exports = {
|
||||
ci: {
|
||||
collect: {
|
||||
staticDistDir: './_site',
|
||||
url: ['http://localhost/', 'http://localhost/components/button/'],
|
||||
},
|
||||
upload: {
|
||||
target: 'temporary-public-storage',
|
||||
},
|
||||
assert: {
|
||||
assertions: {
|
||||
'categories:performance': ['error', { minScore: 0.1 }],
|
||||
'categories:accessibility': ['error', { minScore: 0.6 }],
|
||||
'categories:best-practices': ['error', { minScore: 0.6 }],
|
||||
'categories:seo': ['error', { minScore: 0.6 }],
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
@ -1,5 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
cho "[TEST ALL] check-commit" && \
|
||||
npm run check-commit
|
||||
echo "[TEST ALL] lint" && \
|
||||
npm run lint && \
|
||||
echo "[TEST ALL] dist" && \
|
||||
|
Loading…
Reference in New Issue
Block a user