report test #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lighthouse CI | |
on: [pull_request] | |
jobs: | |
lighthouse: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Audit URLs using Lighthouse | |
uses: treosh/lighthouse-ci-action@v10 | |
with: | |
urls: 'https://quickstarts.teradata.com/' | |
budgetPath: ./budget.json | |
uploadArtifacts: true | |
temporaryPublicStorage: true | |
- name: Get Lighthouse Report | |
run: | | |
mkdir -p lighthouse_report | |
cp lighthouse/*.html lighthouse_report/ | |
- name: Publish Lighthouse Report | |
uses: actions/github-script@v5 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const fs = require('fs'); | |
const { context, github } = require('@actions/github'); | |
const htmlReport = fs.readFileSync('lighthouse_report/report.html', 'utf8'); | |
const comment = `### Lighthouse Report\n\n${htmlReport}`; | |
github.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: comment | |
}); |