Browse Source
* Update lighthouse-ci.yml * Create lighthouserc.js * Update index.js * Add url * fix url * fix assertionspull/24603/head
偏右
5 years ago
committed by
GitHub
3 changed files with 29 additions and 21 deletions
@ -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 |
|||
|
@ -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 }], |
|||
}, |
|||
}, |
|||
}, |
|||
}; |
Loading…
Reference in new issue