From e8ed798a13a485895e730280239d024eeecb1832 Mon Sep 17 00:00:00 2001 From: Livio Date: Sat, 2 May 2020 01:28:16 +0200 Subject: [PATCH 1/4] chore: add lighthouse ci check Resolves #971 --- .github/workflows/lighthouse.yml | 40 ++++++++++++++++++++++++++++++++ lighthouserc.json | 35 ++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 .github/workflows/lighthouse.yml create mode 100644 lighthouserc.json diff --git a/.github/workflows/lighthouse.yml b/.github/workflows/lighthouse.yml new file mode 100644 index 0000000000..d850aeb87e --- /dev/null +++ b/.github/workflows/lighthouse.yml @@ -0,0 +1,40 @@ +name: Lighthouse + +on: + pull_request: + push: + paths-ignore: + - 'content/**/*.md' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Use Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + # Build needs around 400 seconds on Netlify. + # We can not rely on "Waiting for 200", since the user + # might push another commit to an existing PR, meaning + # the deploy preview is already online. + - name: Sleep 400 seconds + run: sleep 400 + - name: Waiting for 200 from the Netlify Preview + uses: jakepartusch/wait-for-netlify-action@v1 + id: wait-for-netflify-preview + with: + site_name: 'docs-nestjs' + max_timeout: 600 + - name: Run Lighthouse on urls and validate with lighthouserc + uses: treosh/lighthouse-ci-action@v2 + with: + urls: | + ${{ steps.wait-for-netflify-preview.outputs.url }} + ${{ steps.wait-for-netflify-preview.outputs.url }}/first-steps + runs: 5 + configPath: './lighthouserc.json' + uploadArtifacts: true + temporaryPublicStorage: true diff --git a/lighthouserc.json b/lighthouserc.json new file mode 100644 index 0000000000..eeca893812 --- /dev/null +++ b/lighthouserc.json @@ -0,0 +1,35 @@ +{ + "ci": { + "collect": { + "numberOfRuns": 5 + }, + "assert": { + "assertions": { + "categories:accessibility": [ + "error", + { "minScore": 0.84, "aggregationMethod": "optimistic" } + ], + "categories:performance": [ + "error", + { "minScore": 0.4, "aggregationMethod": "optimistic" } + ], + "categories:best-practices": [ + "error", + { "minScore": 0.86, "aggregationMethod": "optimistic" } + ], + "categories:seo": [ + "error", + { "minScore": 0.67, "aggregationMethod": "optimistic" } + ], + "categories:pwa": "off", + + "first-contentful-paint": "off", + + "canonical": "off", + "label": "off", + + "color-contrast": "off" + } + } + } +} From 007dec1032e118e824853bed3bdcc0838c44a166 Mon Sep 17 00:00:00 2001 From: Livio Date: Sat, 2 May 2020 01:28:39 +0200 Subject: [PATCH 2/4] feat(a11y): improve accessibility --- src/app/homepage/footer/footer.component.html | 15 ++++++++++++--- src/app/homepage/homepage.component.html | 3 ++- .../homepage/newsletter/newsletter.component.html | 1 + 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/app/homepage/footer/footer.component.html b/src/app/homepage/footer/footer.component.html index 7758914924..af82c677a5 100644 --- a/src/app/homepage/footer/footer.component.html +++ b/src/app/homepage/footer/footer.component.html @@ -1,12 +1,21 @@