From b10540a18b9577b37149724c1df90796ffe6914a Mon Sep 17 00:00:00 2001 From: derberg Date: Thu, 30 Mar 2023 18:42:28 +0200 Subject: [PATCH] chore: make lighthouse check more radical --- .github/workflows/lighthouse-ci.yml | 38 ++++++++++++++++++++++++----- .github/workflows/lighthouserc.json | 4 ++- 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/.github/workflows/lighthouse-ci.yml b/.github/workflows/lighthouse-ci.yml index 65d5b45fbc4e..137d2fb77e8e 100644 --- a/.github/workflows/lighthouse-ci.yml +++ b/.github/workflows/lighthouse-ci.yml @@ -10,19 +10,43 @@ jobs: lighthouse-ci: name: Lighthouse CI runs-on: ubuntu-latest - if: "github.repository == 'asyncapi/website' && github.event.pull_request.draft == false &&!((github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'ci: update global workflows')) || (github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'chore(release):')) || (github.actor == 'allcontributors' && startsWith(github.event.pull_request.title, 'docs: add')))" steps: - - uses: actions/checkout@v3 + - if: > + !github.event.pull_request.draft && !( + (github.actor == 'asyncapi-bot' && ( + startsWith(github.event.pull_request.title, 'ci: update global workflows') || + startsWith(github.event.pull_request.title, 'chore: update code of conduct') || + startsWith(github.event.pull_request.title, 'ci: update global contribution guide') || + startsWith(github.event.pull_request.title, 'ci: update workflows for go projects') || + startsWith(github.event.pull_request.title, 'ci: update workflows for nodejs projects') || + startsWith(github.event.pull_request.title, 'ci: update release-related workflows for nodejs projects') || + startsWith(github.event.pull_request.title, 'ci: update semantic release config file') || + startsWith(github.event.pull_request.title, 'ci: update generic workflows') || + startsWith(github.event.pull_request.title, 'ci: update workflows for docker-based projects') || + startsWith(github.event.pull_request.title, 'chore(release):') + )) || + (github.actor == 'allcontributors[bot]' && + startsWith(github.event.pull_request.title, 'docs: add') + ) + ) + id: should_run + name: Should Run + run: echo "::set-output name=shouldrun::true" + + - if: steps.should_run.outputs.shouldrun == 'true' + uses: actions/checkout@v3 - - name: Await Netlify Preview + - if: steps.should_run.outputs.shouldrun == 'true' + name: Await Netlify Preview uses: jakepartusch/wait-for-netlify-action@v1 id: netlify with: site_name: asyncapi-website max_timeout: 600 - - name: Lighthouse Audit + - if: steps.should_run.outputs.shouldrun == 'true' + name: Lighthouse Audit id: lighthouse_audit uses: treosh/lighthouse-ci-action@9.3.0 with: @@ -34,7 +58,8 @@ jobs: env: PR_NUMBER: ${{ github.event.pull_request.number}} - - name: Lighthouse Score Report + - if: steps.should_run.outputs.shouldrun == 'true' + name: Lighthouse Score Report id: lighthouse_score_report uses: actions/github-script@v6 with: @@ -59,7 +84,8 @@ jobs: ].join('\n') core.setOutput("comment", comment); - - name: LightHouse Statistic Comment + - if: steps.should_run.outputs.shouldrun == 'true' + name: LightHouse Statistic Comment id: lighthouse_statistic_comment uses: marocchino/sticky-pull-request-comment@v2.2.0 with: diff --git a/.github/workflows/lighthouserc.json b/.github/workflows/lighthouserc.json index fe53683665ff..b1a3b6642d9a 100644 --- a/.github/workflows/lighthouserc.json +++ b/.github/workflows/lighthouserc.json @@ -2,7 +2,9 @@ "ci": { "assert": { "assertions": { - "categories:accessibility": ["error", {"minScore": 0.70}] + "categories:accessibility": ["error", {"minScore": 0.98}], + "categories:best-practices": ["error", {"minScore": 1.00}], + "categories:seo": ["error", {"minScore": 1.00}] } }, "collect": {