Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
trending-up

GitHub Action

WP Performance Tests

v0.0.1 Pre-release

WP Performance Tests

trending-up

WP Performance Tests

Measure performance metrics for your WordPress project

Installation

Copy and paste the following snippet into your .yml file.

              

- name: WP Performance Tests

uses: swissspidy/[email protected]

Learn more about this action in swissspidy/wp-performance-action

Choose a version

wp-performance-action

A GitHub action to measure performance metrics of WordPress sites.

Results are posted as comments to pull requests and as GitHub Action job summaries.

It collects data from the Server-Timing header and runs Lighthouse on a given set of URLs.

Screenshot of a GitHub Action job summary output by this action

Usage

Basic Example

Add a workflow (.github/workflows/build-test.yml):

name: 'build-test'
on: # rebuild any PRs and main branch changes
  pull_request:
  push:
    branches:
    - main
    - 'releases/*'

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v3

    - name: Set up Node
      uses: actions/[email protected]
      with:
        node-version-file: '.nvmrc'

    - name: Install dependencies
      run: npm ci

# Here's where you would install dependencies, run your custom build process, etc.

    - name: Run performance tests
      uses: swissspidy/wp-performance-action@main
      with:
        plugins: |
          ./my-awesome-plugin
        urls: |
          http://localhost:8889/
          http://localhost:8889/?p=1

Advanced Example

jobs:
  test:
    runs-on: ubuntu-latest
    steps:

    - name: Run performance tests
      uses: ./
      with:
        urls: |
          /
          /sample/page/
        plugins: |
          ./my-awesome-plugin
          https://downloads.wordpress.org/plugin/performant-translations.zip
          https://downloads.wordpress.org/plugin/wordpress-seo.zip
        iterations: 5
        repetitions: 1