Skip to content

feat(run-lhci-test): output all the scores #121

feat(run-lhci-test): output all the scores

feat(run-lhci-test): output all the scores #121

Workflow file for this run

name: Test Actions
on: [pull_request, workflow_dispatch]
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test-performance-flow:
name: Performance flow (Setup WP, Elementor env and run Lighthouse tests)
runs-on: ubuntu-latest
if: startsWith( github.repository, 'elementor/' )
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Setup WP Env
uses: ./actions/setup-wp-env
with:
php: '8.0'
wp: '6.6'
active-theme: 'hello-elementor'
themes: |-
https://downloads.wordpress.org/theme/hello-elementor.zip
plugins: |-
https://downloads.wordpress.org/plugin/elementor.zip
mappings: |-
elementor-templates:./stubs/elementor-templates
config: |-
ELEMENTOR_SHOW_HIDDEN_EXPERIMENTS:1
- name: Setup Elementor Env
uses: ./actions/setup-elementor-env
with:
env: 'testing'
experiments: |-
pages_panel:true
editor_v2:false
e_nested_atomic_repeaters:false
templates: |-
elementor-templates
- name: Run Lighthouse tests
uses: ./actions/run-lighthouse-tests
id: run-lighthouse-tests
with:
number-of-runs: 3
urls: |-
rquth:http://localhost:8889/react-query-under-the-hood/
categories: |-
performance
- name: Check if score meets the threshold
uses: actions/github-script@v7
env:
PERFORMANCE_SCORE: ${{ steps.run-lighthouse-tests.outputs.rquth-performance-median-score }}
THRESHOLD: 0.70
with:
script: |
const { PERFORMANCE_SCORE, THRESHOLD } = process.env;
if (PERFORMANCE_SCORE < THRESHOLD) {
core.setFailed(`Performance score is ${PERFORMANCE_SCORE}, which is below the threshold of ${threshold}.`);
}
- name: Upload reports
if: failure() && steps.run-lighthouse-tests.outputs.reports-path
uses: actions/upload-artifact@v4
with:
name: performance-reports
path: ${{ steps.run-lighthouse-tests.outputs.reports-path }}
retention-days: 3