mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 16:06:28 +08:00
test: ✅ Add lighthouse-check-action (#24298)
This commit is contained in:
parent
6f1fe30df1
commit
a7b81d52af
39
.github/workflows/lighthouse-ci.yml
vendored
39
.github/workflows/lighthouse-ci.yml
vendored
@ -1,19 +1,30 @@
|
||||
name: Lighthouse
|
||||
on: push
|
||||
name: Lighthouse Check
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
lighthouse:
|
||||
lighthouse-check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Audit URLs using Lighthouse
|
||||
uses: treosh/lighthouse-ci-action@v2
|
||||
- uses: actions/checkout@master
|
||||
- run: mkdir /tmp/artifacts
|
||||
- name: Run Lighthouse
|
||||
uses: foo-software/lighthouse-check-action@master
|
||||
id: lighthouseCheck
|
||||
with:
|
||||
urls: |
|
||||
https://ant.design
|
||||
https://ant.design/docs/react/introduce-cn
|
||||
https://ant.design/components/button-cn
|
||||
- name: Save results
|
||||
uses: actions/upload-artifact@v1
|
||||
accessToken: ${{ secrets.GITHUB_TOKEN }}
|
||||
outputDirectory: /tmp/artifacts
|
||||
emulatedFormFactor: desktop
|
||||
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-results
|
||||
path: '.lighthouseci' # This will save the Lighthouse results as .json files
|
||||
name: Lighthouse reports
|
||||
path: /tmp/artifacts
|
||||
- name: Handle Lighthouse Check results
|
||||
uses: foo-software/lighthouse-check-status-action@master
|
||||
with:
|
||||
lighthouseCheckResults: ${{ steps.lighthouseCheck.outputs.lighthouseCheckResults }}
|
||||
minAccessibilityScore: "70"
|
||||
minBestPracticesScore: "80"
|
||||
minPerformanceScore: "5"
|
||||
minSeoScore: "70"
|
||||
|
@ -228,7 +228,7 @@
|
||||
"prettier": "^2.0.1",
|
||||
"pretty-quick": "^2.0.0",
|
||||
"querystring": "^0.2.0",
|
||||
"rc-footer": "^0.6.0",
|
||||
"rc-footer": "^0.6.3",
|
||||
"rc-queue-anim": "^1.6.12",
|
||||
"rc-scroll-anim": "^2.5.8",
|
||||
"rc-tween-one": "^2.4.1",
|
||||
|
Loading…
Reference in New Issue
Block a user