Git Product home page Git Product logo

lighthouse-ci-action's Introduction

shopify/lighthouse-ci-action

About this repo | Usage | Authentication | Configuration

About this repo

Lighthouse CI on Shopify Theme Pull Requests using GitHub Actions.

Usage

Add shopify/lighthouse-ci-action to the workflow of your Shopify theme.

# .github/workflows/lighthouse-ci.yml
name: Shopify Lighthouse CI
on: [push]
jobs:
  lhci:
    name: Lighthouse
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Lighthouse
        uses: shopify/[email protected]
        with:
          store: ${{ secrets.SHOP_STORE }}
          access_token: ${{ secrets.SHOP_ACCESS_TOKEN }}
          lhci_github_app_token: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
          lhci_min_score_performance: 0.9
          lhci_min_score_accessibility: 0.9

Authentication

Authentication is done with Custom App access tokens.

  1. Create the app.
  2. Click the Configure Admin API Scopes button.
  3. Enable the following scopes:
    • read_products
    • write_themes
  4. Click Save.
  5. From the API credentials tab, install the app.
  6. Take note of the Admin API access token.
  7. Add the following to your repository's GitHub Secrets:
    • SHOP_ACCESS_TOKEN: the Admin API access token
    • SHOP_STORE: Shopify store <store>.myshopify.com URL

Configuration

The shopify/lighthouse-ci-action accepts the following arguments:

  • access_token - (required) see Authentication
  • store - (required) Shopify store Admin URL, e.g. my-store.myshopify.com.
  • password - (optional) For password protected shops
  • product_handle - (optional) Product handle to run the product page Lighthouse run on. Defaults to the first product.
  • theme_root - (optional) The root folder for the theme files that will be uploaded. Defaults to .
  • collection_handle - (optional) Collection handle to run the product page Lighthouse run on. Defaults to the first collection.
  • pull_theme - (optional) The ID or name of a theme from which the settings and JSON templates should be used. If not provided Lighthouse will be run against the theme's default settings.
  • lhci_min_score_performance - (optional, default: 0.6) Minimum performance score for a passed audit (must be between 0 and 1).
  • lhci_min_score_accessibility - (optional, default: 0.9) Minimum accessibility score for a passed audit

For the GitHub Status Checks on PR. One of the two arguments is required:

  • lhci_github_app_token - (optional) Lighthouse GitHub app token
  • lhci_github_token - (optional) GitHub personal access token

For more details on the implications of choosing one over the other, refer to the Lighthouse CI Getting Started Page

lighthouse-ci-action's People

Contributors

charlespwd avatar jamesmengo avatar karreiro avatar anark avatar charlienaud avatar lukeshumard avatar muriloshimizu avatar gideonb avatar mgmanzella avatar cursedcoder avatar burakduganci avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.