test: Add lighthouse-check-action (#24298)

This commit is contained in:
偏右 2020-05-20 14:26:08 +08:00 committed by GitHub
parent 6f1fe30df1
commit a7b81d52af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 15 deletions

View File

@ -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"

View File

@ -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",