This action uses GTMetrix API 2.0 and provides the following features :
launch-gtmetrix-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ingeno/gtmetrix-action@v1
with:
api_key: ${{ secrets.GTMETRIX_API_KEY }}
configuration_file: ./config.yml
api_key
and configuration_file
are both required. In this example, the file config.yml would be at the root of the repository.
You can configure the test launch parameters by using the exact same key as in the API.
poll_interval: 6
test_configuration:
report: lighthouse
simulate_device: nexus_5
url: https://www.google.com
video: false
Only test_configuration.url
is required. poll_interval
defaults to 3.
You can configure the requirement parameters by using the exact same key as in the API.
test_configuration:
report: legacy
url: https://www.google.com
video: true
requirements:
structure_score: 95
onload_duration: 4
gtmetrix_grade: A
Outputs contains the every links in the report response and every attributes except these ones : browser
, location
and source
. Some outputs might not be present depending of your test parameters. For example, the gtmetrix_grade
is only available when the test parameter report
is lighthouse
.
- Retry on requirements failure
- Support API rate limiting