Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Lighthouse test GitHub action #2084

Merged
merged 2 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/lighthouse-badger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Lighthouse-Badger-Easy | GitHub Action Workflow
#
# Description: Generates, adds & updates manually/automatically Lighthouse badges & reports from one/multiple input URL(s) to the current repository & main branch with minimal settings
# Author: Sitdisch
# Source: https://github.com/myactionway/lighthouse-badger-workflows
# License: MIT
# Copyright (c) 2021 Sitdisch

name: "Lighthouse Badger"

########################################################################
# DEFINE YOUR INPUTS AND TRIGGERS IN THE FOLLOWING
########################################################################

# INPUTS as environmental variables (env) for not manually triggered workflows
env:
URLS: https://alshedivat.github.io/al-folio/
TOKEN_NAME: LIGHTHOUSE_BADGER_TOKEN
# If any of the following env is blank, a default value is used instead
REPO_BRANCH: "${{ github.repository }} master" # target repository & branch e.g. 'dummy/mytargetrepo main'
MOBILE_LIGHTHOUSE_PARAMS: "--only-categories=performance,accessibility,best-practices,seo --throttling.cpuSlowdownMultiplier=2"
DESKTOP_LIGHTHOUSE_PARAMS: "--only-categories=performance,accessibility,best-practices,seo --preset=desktop --throttling.cpuSlowdownMultiplier=1"

# TRIGGERS
on:
page_build:
# schedule: # Check your schedule here => https://crontab.guru/
# - cron: '55 23 * * 0' # e.g. every Sunday at 23:55
#
# THAT'S IT; YOU'RE DONE;
workflow_dispatch:

########################################################################
# THAT'S IT; YOU DON'T HAVE TO DEFINE ANYTHING IN THE FOLLOWING
########################################################################

jobs:
lighthouse-badger-easy:
runs-on: ubuntu-latest
timeout-minutes: 8
steps:
- name: Preparatory Tasks
run: |
REPOSITORY=`expr "${{ env.REPO_BRANCH }}" : "\([^ ]*\)"`
BRANCH=`expr "${{ env.REPO_BRANCH }}" : ".* \([^ ]*\)"`
echo "REPOSITORY=$REPOSITORY" >> $GITHUB_ENV
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
env:
REPO_BRANCH: ${{ env.REPO_BRANCH }}
- uses: actions/checkout@v3
with:
repository: ${{ env.REPOSITORY }}
token: ${{ secrets[github.event.inputs.token_name] || secrets[env.TOKEN_NAME] }}
ref: ${{ env.BRANCH }}
- uses: actions/checkout@v3
with:
repository: "myactionway/lighthouse-badges"
path: temp_lighthouse_badges_nested
- uses: myactionway/lighthouse-badger-action@v2.2
with:
urls: ${{ env.URLS }}
mobile_lighthouse_params: ${{ env.MOBILE_LIGHTHOUSE_PARAMS }}
desktop_lighthouse_params: ${{ env.DESKTOP_LIGHTHOUSE_PARAMS }}
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,25 @@ Workshop on Diffusion Models (NeurIPS: <a href="https://diffusionworkshop.github

## Lighthouse PageSpeed Insights

[![Google PageSpeed](https://github.com/raw/alshedivat/al-folio/master/assets/img/pagespeed.svg)](https://pagespeed.web.dev/report?url=https%3A%2F%2Falshedivat.github.io%2Fal-folio%2F&form_factor=desktop)
### Desktop

[![Google Lighthouse PageSpeed Insights](lighthouse_results/desktop/pagespeed.svg)](https://htmlpreview.github.io/?https://github.com/alshedivat/al-folio/blob/main/lighthouse_results/desktop/alshedivat_github_io_al_folio_.html)

Run the test yourself: [Google Lighthouse PageSpeed Insights](https://pagespeed.web.dev/report?url=https%3A%2F%2Falshedivat.github.io%2Fal-folio%2F&form_factor=desktop)

### Mobile

[![Google Lighthouse PageSpeed Insights](lighthouse_results/mobile/pagespeed.svg)](https://htmlpreview.github.io/?https://github.com/alshedivat/al-folio/blob/main/lighthouse_results/mobile/alshedivat_github_io_al_folio_.html)

Run the test yourself: [Google Lighthouse PageSpeed Insights](https://pagespeed.web.dev/report?url=https%3A%2F%2Falshedivat.github.io%2Fal-folio%2F&form_factor=mobile)

## Table Of Contents

- [al-folio](#al-folio)
- [User community](#user-community)
- [Lighthouse PageSpeed Insights](#lighthouse-pagespeed-insights)
- [Desktop](#desktop)
- [Mobile](#mobile)
- [Table Of Contents](#table-of-contents)
- [Getting started](#getting-started)
- [Installing](#installing)
Expand Down