Skip to content

Commit

Permalink
Merge pull request #4805 from guardian/revert-4773-jtl-surface-lighth…
Browse files Browse the repository at this point in the history
…ouse
  • Loading branch information
mxdvl authored May 3, 2022
2 parents 6c6e83f + 351837f commit db10cc4
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 251 deletions.
60 changes: 22 additions & 38 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,25 @@
name: DCR Run Lighthouse CI
on:
push:
branches:
- main
paths-ignore:
- "apps-rendering/**"
pull_request:
# If/when we compare results to `main`, we should also run on 'reopened'
types: [opened, synchronize]

push:
paths-ignore:
- "apps-rendering/**"
jobs:
lhci:
name: DCR Lighthouse
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Node
uses: guardian/actions-setup-node@main
# Make sure we install dependencies in the root directory
- uses: bahmutov/npm-install@v1
- run: make build
working-directory: dotcom-rendering
- name: Install and run Lighthouse CI
working-directory: dotcom-rendering
env:
LHCI_GITHUB_TOKEN: ${{ secrets.LHCI_GITHUB_TOKEN }}
run: |
npm install -g [email protected] @lhci/[email protected]
lhci autorun
- name: Setup deno
uses: denolib/setup-deno@v2
with:
deno-version: v1.21.0

- name: Surface Lighthouse Results
run: deno run --no-check --allow-net=api.github.com --allow-env="GITHUB_TOKEN","GITHUB_EVENT_PATH" --allow-read scripts/deno/surface-lighthouse-results.ts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
lhci:
name: DCR Lighthouse
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Node
uses: guardian/actions-setup-node@main
# Make sure we install dependencies in the root directory
- uses: bahmutov/npm-install@v1
- run: make build
working-directory: dotcom-rendering
- name: Install and run Lighthouse CI
working-directory: dotcom-rendering
env:
LHCI_GITHUB_TOKEN: ${{ secrets.LHCI_GITHUB_TOKEN }}
run: |
npm install -g [email protected] @lhci/[email protected]
lhci autorun
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,3 @@ coverage

# Architecture Diagram
webArchitecture.svg

# lighthouse results from local build
.lighthouseci/
3 changes: 1 addition & 2 deletions dotcom-rendering/lighthouserc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ module.exports = {
puppeteerScript: './scripts/lighthouse/puppeteer-script.js',
settings: {
onlyCategories: "accessibility,best-practices,performance,seo",
disableStorageReset: true,
disableStorageReset: true
}
},
upload: {
target: 'temporary-public-storage',
},
assert: {
includePassedAssertions: true,
assertions: {
"first-contentful-paint": ["warn", {"maxNumericValue": 1500}],
"largest-contentful-paint": ["warn", {"maxNumericValue": 3000}],
Expand Down
208 changes: 0 additions & 208 deletions scripts/deno/surface-lighthouse-results.ts

This file was deleted.

0 comments on commit db10cc4

Please sign in to comment.