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
⚡️🚀 GitHub Action to print webPageTest.org results as a commit comment after a push.
Make sure to pass a WEBPAGETEST_API_KEY which you can get here and a TEST_URL.
www.webpagetest.org
server offered by Akami but you can provide your own hosted version.https://jcofman.de
You should be able to provide custom args as mentioned in the marcelduran/webpagetest-api under the Test (works for test command only)
section.
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"
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!