From 933a1fe0cd70a84f1a750c92eac158ecb2462625 Mon Sep 17 00:00:00 2001 From: Jake Jarvis Date: Mon, 30 Mar 2020 00:52:18 -0400 Subject: [PATCH] fix lighthouse CI tests --- .github/workflows/ci.yml | 3 --- lighthouserc.json | 1 + package.json | 7 ++++--- yarn.lock | 10 +++++----- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 964690b5..58512b44 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,6 @@ jobs: run: | lhci autorun --config=./lighthouserc.json \ --collect.url=https://deploy-preview-${{ github.event.number }}--jakejarvis.netlify.com/ \ - --collect.url=https://deploy-preview-${{ github.event.number }}--jakejarvis.netlify.com/notes/ \ --collect.url=https://deploy-preview-${{ github.event.number }}--jakejarvis.netlify.com/notes/how-to-pull-request-fork-github/ \ --collect.url=https://deploy-preview-${{ github.event.number }}--jakejarvis.netlify.com/notes/how-to-pull-request-fork-github/amp.html env: @@ -50,13 +49,11 @@ jobs: run: | lhci autorun --config=./lighthouserc.json \ --collect.url=https://jarv.is/ \ - --collect.url=https://jarv.is/notes/ \ --collect.url=https://jarv.is/notes/how-to-pull-request-fork-github/ \ --collect.url=https://jarv.is/notes/how-to-pull-request-fork-github/amp.html env: LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} - name: Upload results as artifact - if: success() uses: actions/upload-artifact@v1 with: name: lhci-results diff --git a/lighthouserc.json b/lighthouserc.json index 39418dba..696be188 100644 --- a/lighthouserc.json +++ b/lighthouserc.json @@ -9,6 +9,7 @@ "color-contrast": ["warn", {"minScore": 0.9}], "errors-in-console": "warn", "link-text": "warn", + "offscreen-images": "warn", "tap-targets": ["warn", {"minScore": 0.6}], "total-byte-weight": ["warn", {"minScore": 0.9}], "unused-css-rules": "warn", diff --git a/package.json b/package.json index 9c250b9b..590c4971 100644 --- a/package.json +++ b/package.json @@ -21,9 +21,9 @@ "hugo:dev": "hugo --environment development --baseURL \"${DEPLOY_PRIME_URL:-/}\" --buildDrafts --buildFuture --gc --cleanDestinationDir --verbose", "start": "hugo server --buildDrafts --buildFuture --port 1337 --bind 0.0.0.0 --verbose", "optimize": "run-s optimize:**", - "optimize:emoji": "rimraf public/twemoji/72x72 public/twemoji/*.html", + "optimize:emoji": "rimraf public/twemoji/{*.html,72x72}", "optimize:html": "html-minifier --html5 --collapse-whitespace --collapse-boolean-attributes --preserve-line-breaks --minify-css --file-ext html --input-dir public --output-dir public **/*.html", - "optimize:img": "find ./public -type d ! -path './public/twemoji*' | xargs -n1 -P8 -I{} imagemin {}/* --plugin=jpegoptim --plugin.jpegoptim.progressive --plugin.jpegoptim.stripAll --plugin=pngquant --plugin.pngquant.speed=5 --plugin.pngquant.strip --plugin=optipng --plugin.optipng.optimizationLevel=2 --plugin=gifsicle --out-dir={}", + "optimize:img": "find ./public -type d ! -path './public/twemoji*' | xargs -n1 -P8 -I{} imagemin {}/* --plugin=jpegoptim --plugin.jpegoptim.progressive --plugin.jpegoptim.stripAll --plugin=pngquant --plugin.pngquant.speed=5 --plugin.pngquant.strip --plugin=optipng --plugin.optipng.optimizationLevel=2 --plugin=gifsicle --plugin=svgo --out-dir={}", "lint": "run-s lint:**", "lint:scss": "stylelint assets/sass/**/* --syntax scss", "lint:md": "markdownlint --rules markdownlint-rule-emphasis-style content/**/*.md content/**/**/*.md", @@ -44,7 +44,8 @@ "imagemin-mozjpeg": "^8.0.0", "imagemin-optipng": "^7.1.0", "imagemin-pngquant": "^8.0.0", - "lint-staged": "^10.0.9", + "imagemin-svgo": "^7.1.0", + "lint-staged": "^10.0.10", "markdownlint-cli": "~0.22.0", "markdownlint-rule-emphasis-style": "~1.0.1", "npm-run-all": "^4.1.5", diff --git a/yarn.lock b/yarn.lock index 2a8030ad..72414e48 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3046,7 +3046,7 @@ imagemin-pngquant@^8.0.0: ow "^0.13.2" pngquant-bin "^5.0.0" -imagemin-svgo@^7.0.0: +imagemin-svgo@^7.0.0, imagemin-svgo@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/imagemin-svgo/-/imagemin-svgo-7.1.0.tgz#528a42fd3d55eff5d4af8fd1113f25fb61ad6d9a" integrity sha512-0JlIZNWP0Luasn1HT82uB9nU9aa+vUj6kpT+MjPW11LbprXC+iC4HDwn1r4Q2/91qj4iy9tRZNsFySMlEpLdpg== @@ -3667,10 +3667,10 @@ linkify-it@^2.0.0: dependencies: uc.micro "^1.0.1" -lint-staged@^10.0.9: - version "10.0.9" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-10.0.9.tgz#185aabb2432e9467c84add306c990f1c20da3cdb" - integrity sha512-NKJHYgRa8oI9c4Ic42ZtF2XA6Ps7lFbXwg3q0ZEP0r55Tw3YWykCW1RzW6vu+QIGqbsy7DxndvKu93Wtr5vPQw== +lint-staged@^10.0.10: + version "10.0.10" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-10.0.10.tgz#d14d33ee02a31a31ad36cf9aa7973fc156c461b5" + integrity sha512-91vNy3eYStExElLWw1Idva5lghKpFaXh9AJqjcyrJXf7AYZrThi4EhQ+GpmiHdPmJJauKhZMMSzQR1bMB90MtA== dependencies: chalk "^3.0.0" commander "^4.0.1"