Skip to content

Commit

Permalink
Dedicated lighthouse GH action (#959)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkuthan authored Nov 24, 2022
1 parent f8efc63 commit bd2e3c6
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 83 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,7 @@ jobs:
uses: ./.github/workflows/deploy.yml
secrets: inherit

lighthouse-report:
reports:
needs: required-checks
uses: ./.github/workflows/lighthouse-report.yml
secrets: inherit

size-report:
needs: required-checks
uses: ./.github/workflows/size-report.yml
uses: ./.github/workflows/reports.yml
secrets: inherit
55 changes: 0 additions & 55 deletions .github/workflows/lighthouse-report.yml

This file was deleted.

52 changes: 52 additions & 0 deletions .github/workflows/reports.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Reports

on:
workflow_call: ~
workflow_dispatch: ~

jobs:
size:
runs-on: ubuntu-latest

if: github.event_name == 'pull_request'

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup

- uses: andresz1/size-limit-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
build_script: build:client
skip_step: install

lighthouse:
runs-on: ubuntu-latest

if: github.event_name == 'pull_request'

# add permission to comment PR created by dependabot
permissions:
issues: write
pull-requests: write

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: npm run build
- uses: treosh/lighthouse-ci-action@v9
id: lighthouse
with:
uploadArtifacts: true
temporaryPublicStorage: true
- uses: actions/github-script@v6
with:
script: |
const lighthouse_links = ${{ steps.lighthouse.outputs.links }}
const lighthouse_link = Object.values(lighthouse_links)[0]
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: ':stopwatch: Lighthouse [report](' + lighthouse_link + ')'
})
21 changes: 0 additions & 21 deletions .github/workflows/size-report.yml

This file was deleted.

0 comments on commit bd2e3c6

Please sign in to comment.