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",