From d7c8ef4792bb1f0722e2fe020ee6d66ad56d95e1 Mon Sep 17 00:00:00 2001 From: Helio Machado <0x2b3bfa0+git@googlemail.com> Date: Sat, 21 Nov 2020 00:49:39 +0100 Subject: [PATCH] Initial commit --- .github/workflows/report.yml | 110 + LICENSE | 674 ++++ README.md | 11 + pages/index.html | 115 + pages/report.html | 7156 ++++++++++++++++++++++++++++++++++ 5 files changed, 8066 insertions(+) create mode 100644 .github/workflows/report.yml create mode 100644 LICENSE create mode 100644 README.md create mode 100644 pages/index.html create mode 100644 pages/report.html diff --git a/.github/workflows/report.yml b/.github/workflows/report.yml new file mode 100644 index 0000000..fca54fe --- /dev/null +++ b/.github/workflows/report.yml @@ -0,0 +1,110 @@ +name: Lighthouse report + +on: + schedule: + - cron: "0 0 * * *" + workflow_dispatch: + +jobs: + lighthouse-check: + runs-on: ubuntu-latest + steps: + - name: Checkout the repository + uses: actions/checkout@main + + - name: Checkout the reports branch + run: | + git fetch --all + git checkout origin/reports + + - name: Create temporary directories + run: | + test -f ./reports.json || touch ./reports.json + mkdir -p /tmp/artifacts ./reports + + - name: Generate the report + uses: foo-software/lighthouse-check-action@master + with: + author: ${{ github.actor }} + outputDirectory: /tmp/artifacts + urls: https://helpfulengineering.org + emulatedFormFactor: desktop + + - name: Process the report results + id: results + run: | + echo "::set-output name=accessibility::$(jq -r .[0].scores.accessibility < /tmp/artifacts/results.json)" + echo "::set-output name=bestPractices::$(jq -r .[0].scores.bestPractices < /tmp/artifacts/results.json)" + echo "::set-output name=performance::$(jq -r .[0].scores.performance < /tmp/artifacts/results.json)" + echo "::set-output name=progressiveWebApp::$(jq -r .[0].scores.progressiveWebApp < /tmp/artifacts/results.json)" + echo "::set-output name=seo::$(jq -r .[0].scores.seo < /tmp/artifacts/results.json)" + jq -s '.[0] + .[1]' reports.json /tmp/artifacts/results.json > /tmp/artifacts/mix.json + mv /tmp/artifacts/mix.json reports.json + + base="$(basename "$(jq -r .[0].localReport < /tmp/artifacts/results.json)")" + time="$(grep -o '[0-9]' <<< "${base%.json.gz}" | tr -d '\n')" + echo "::set-output name=time::$time" + + for report in /tmp/artifacts/*.html; do + base="$(basename "$report")"; name="${base%.html}"; time="${name/lighthouse-report-}" + perl -ne '/ + + + diff --git a/pages/report.html b/pages/report.html new file mode 100644 index 0000000..1617444 --- /dev/null +++ b/pages/report.html @@ -0,0 +1,7156 @@ + + + + + + + + Lighthouse Report + + + + + + +
+ +
+ + + + + + +