mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 17:44:35 +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
|
name: CI
|
||||||
on: [pull_request]
|
on: [push]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lighthouse-check:
|
lighthouseci:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@v2
|
||||||
- run: mkdir /tmp/artifacts
|
- uses: actions/setup-node@v1
|
||||||
- name: Run Lighthouse
|
- run: npm install && npm install -g @lhci/cli@0.4.x
|
||||||
uses: foo-software/lighthouse-check-action@master
|
- run: npm run site
|
||||||
id: lighthouseCheck
|
- run: lhci autorun --upload.target=temporary-public-storage
|
||||||
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
|
|
||||||
|
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
|
#!/bin/sh
|
||||||
|
|
||||||
|
cho "[TEST ALL] check-commit" && \
|
||||||
|
npm run check-commit
|
||||||
echo "[TEST ALL] lint" && \
|
echo "[TEST ALL] lint" && \
|
||||||
npm run lint && \
|
npm run lint && \
|
||||||
echo "[TEST ALL] dist" && \
|
echo "[TEST ALL] dist" && \
|
||||||
|
Loading…
Reference in New Issue
Block a user