Skip to content

JCofman/webPagetestAction

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

⚠️ Deprecated!

Since webpagetest has a paid business model now you may want to checkout their official github action. You can still use this action if you have a valid WebPageTest API key or set up your own WebPageTest instance

WebPageTest GitHub Action

All Contributors

⚡️🚀 GitHub Action to print webPageTest.org results as a commit comment after a push.

Click to see example commit comment

example image

Make sure to pass a WEBPAGETEST_API_KEY which you can get here and a TEST_URL.

Secrets

  • GITHUB_TOKEN - Required GitHub token provided by actions to validate requests and make sure you are allowed to comment on the repo
  • WEBPAGETEST_API_KEY - Required API key which you either can provide by your own hosted WebPageTest instance or can get here here

Environment Variables

  • WEBPAGETEST_SERVER_URL - Optional By default this repo uses the awesome free WebPageTest www.webpagetest.org server offered by Akami but you can provide your own hosted version.
  • TEST_URL - URL to run the audit e.g. https://jcofman.de

Args

You should be able to provide custom args as mentioned in the marcelduran/webpagetest-api under the Test (works for test command only) section.

Examples

on: push
name: Run Webpagetest
jobs:
  webPageTestActions:
    name: WebPageTestActions
    runs-on: ubuntu-latest
    steps:
      - uses: JCofman/webPagetestAction@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          TEST_URL: https://example.com
          WEBPAGETEST_API_KEY: ${{ secrets.WEBPAGETEST_API_KEY }}

With self hosted WebPagetest server

on: push
name: Run Webpagetest
jobs:
  webPageTestActions:
    name: WebPageTestActions
    runs-on: ubuntu-latest
    steps:
      - uses: JCofman/webPagetestAction@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          TEST_URL: https://example.com
          WEBPAGETEST_API_KEY: ${{ secrets.WEBPAGETEST_API_KEY }}
          WEBPAGETEST_SERVER_URL: www.your-custom-server.org

When you use the default action without any custom arguments some defaults will be set:

        location: "Dulles_MotoG4", // <location> string to test from https://www.webpagetest.org/getLocations.php?f=html
        connectivity:  "3GSlow", // <profile> string: connectivity profile -- requires location to be specified -- (Cable|DSL|3GSlow|3G|3GFast|4G|LTE|Edge|2G|Dial|FIOS|Native|custom) [Cable]
        runs: 3, // <number>: number of test runs [1]
        first: false, // skip the Repeat View test
        video: true, // capture video
        pollResults: 5, // <number>: poll results
        private: true, // keep the test hidden from the test log
        label: "Github Action", // <label>: string label for the test
        mobile: 1,
        device: "Motorola G (gen 4)",
        timeout: 10000,
        lighthouse: true,

You can provide your own custom args like the location and connectivity ⚠️ keep in mind that some devices locations and arguments don't work together ⚠️. You can find more details here

on: push
name: Run Webpagetest
jobs:
  webPageTestActions:
    name: WebPageTestActions
    runs-on: ubuntu-latest
    steps:
      - uses: JCofman/webPagetestAction@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          TEST_URL: https://example.com
          WEBPAGETEST_API_KEY: ${{ secrets.WEBPAGETEST_API_KEY }}
          WEBPAGETEST_SERVER_URL: www.your-custom-server.org
         with:
          args: location="Dulles_Nexus5" connectivity="DSL"

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Markus Staab

📖 🤔

Jacob Cofman

📖 💻 💡

Sindre Bøyum

💻

This project follows the all-contributors specification. Contributions of any kind welcome!