Git Product home page Git Product logo

webpagetestaction's Introduction

⚠️ 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!

webpagetestaction's People

Contributors

allcontributors[bot] avatar boyum avatar dependabot[bot] avatar jcofman avatar staabm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

webpagetestaction's Issues

action is not running on Pull Requests

hey! 👋

I wanted to add this action to my workflow and seems that is not running and I know why. but first let me explain my workflow:

on pull_request:

  1. build the project on the staging environment (netlify)
  2. get the unique Build URL from the artifacts
  3. AFTER build, run webpagetest on the unique build URL
  4. run performance budgets
  5. print the results on the Pull request comments.

this actions is the part 3, but it only runs on push, not pull requests: see the if statement here

My suggestion:

  • remove the if statement: let the actions user decide when to run it
  • fix the comment creation: this seems to be broken. check the message I got:
    Screen Shot 2019-11-24 at 12 31 54 PM
  • maybe createCommitComment is not the right method but octokit.pulls.createComment ?
octokit.pulls.createComment({
  owner,
  repo,
  pull_number,
  body,
  commit_id,
  path
})

actually, now I'm thinking it would be nice to instead of removing the if statement, change it to a switch, so depending on where the user run it, it will do the appropiate octokit API calls.

I forked the repo and I'm doing testings myself. if I get any progress I will post it here! (and eventually submit a PR) :)

thanks!

run the action on comment/command instead of every push

Wouldn't it make sense to run the action based on a user command with a given test-url, like

/webpagetest https://www.mywebsite/my-deep-url/

That way we could test urls which are more related to a pull request (instead of measuring only a single „hardcode“ url)

inspiration can be taken from e.g. https://github.com/cirrus-actions/rebase which does that with a different command.

I have no experience with docker or authoring github actions, therefore won't tackle it myself in the next weeks/months though.

Show scores

I think it'd be very useful to show the score results first thing in the commit comment. I find this and the waterfall most useful, and screenshots less so. In fact, might it be better to show a minimal view with only the score, then link out to the full result to prevent the PR thread from getting cluttered? Just imho.

wpt scores

Error: Can't find 'action.yml' or 'Dockerfile'

This action is a great idea and I can't wait to start using it! I used the example from the readme with my own API key and test URL, but I'm getting this error:

##[error]Can't find 'action.yml' or 'Dockerfile' under '/home/runner/work/Actions-Again/Actions-Again'.

*(note: "Actions-Again" is my repo name that I'm learning actions with)

Am I doing something wrong? Here is a screenshot for reference if that helps:

Screen Shot 2019-08-23 at 5 08 01 PM

example with test arguments

the readme mentions that you can use the "Test (works for test command only)" args ... would be great it would also show a example where in the YAML code this args need to be provided

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.