From a8f81cd128c94abdc744bb55441e044e4f5999a1 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Tue, 12 Nov 2019 00:05:54 +0100 Subject: [PATCH] switch to new Lighthouse CI --- .github/workflows/ci.yml | 23 +++++++++++++++++++++++ .github/workflows/lighthouserc.json | 15 +++++++++++++++ package.json | 4 +--- 3 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/lighthouserc.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7d662b1..cee3b72 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,3 +80,26 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + + lighthouse: + needs: deploy + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + + - name: Audit Beta using Lighthouse + if: success() && github.event_name == 'pull_request' + uses: treosh/lighthouse-ci-action@v2 + with: + urls: 'https://beta.matthiaskretschmann.com' + configPath: './.github/workflows/lighthouserc.json' + temporaryPublicStorage: 'true' + + - name: Audit Live using Lighthouse + if: success() && github.ref == 'refs/heads/master' + uses: treosh/lighthouse-ci-action@v2 + with: + urls: 'https://matthiaskretschmann.com' + configPath: './.github/workflows/lighthouserc.json' + temporaryPublicStorage: 'true' diff --git a/.github/workflows/lighthouserc.json b/.github/workflows/lighthouserc.json new file mode 100644 index 0000000..8038c2b --- /dev/null +++ b/.github/workflows/lighthouserc.json @@ -0,0 +1,15 @@ +{ + "ci": { + "collect": { + "numberOfRuns": 3 + }, + "assert": { + "preset": "lighthouse:recommended", + "assertions": { + "font-display": "off", + "dom-size": "off", + "color-contrast": "off" + } + } + } +} diff --git a/package.json b/package.json index eab7a2d..892f607 100644 --- a/package.json +++ b/package.json @@ -19,8 +19,7 @@ "test": "npm run lint && jest --coverage --silent", "test:watch": "npm run lint && jest --coverage --watch", "deploy": "./scripts/deploy.sh", - "new": "babel-node ./scripts/new.js", - "lh": "lighthousebot --pwa=90 --perf=90 --a11y=90 --bp=90 --seo 90 --runner=wpt" + "new": "babel-node ./scripts/new.js" }, "dependencies": { "@loadable/component": "^5.10.3", @@ -84,7 +83,6 @@ "jest": "^24.9.0", "jest-canvas-mock": "^2.2.0", "js-yaml": "^3.13.1", - "lighthousebot": "git+https://github.com/GoogleChromeLabs/lighthousebot.git", "node-sass": "^4.13.0", "ora": "^4.0.3", "prepend": "^1.0.2",