Skip to content

CI: Do not skip lint check (for enable required check) (#35371) #197

CI: Do not skip lint check (for enable required check) (#35371)

CI: Do not skip lint check (for enable required check) (#35371) #197

Workflow file for this run

name: Lighthouse
on:
pull_request:
paths-ignore:
- '**.md'
- '**.txt'
- '.github/config.json'
- 'bin/**'
- '.gitignore'
- 'docs/**'
- '.vscode/**'
push:
branches:
- 'main'
- '[0-9].[0-9][0-9]'
paths-ignore:
- '**.md'
- '**.txt'
- '.github/config.json'
- 'bin/**'
- '.gitignore'
- 'docs/**'
merge_group:
jobs:
build-plugin-lh:
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run-tests')
name: Build plugin
uses: ./.github/workflows/build.yml
lighthouse_test:
name: Lighthouse test - WP latest on PHP 7.4
runs-on: ubuntu-latest
needs: [build-plugin-lh]
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run-tests')
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Remove package.json
run: rm -f package*.json
- name: Install Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: ${{ needs.build-plugin-lh.outputs.artifact_name }}
path: ./elementor
- name: Setup wp-env
uses: elementor/elementor-editor-github-actions/actions/setup-wp-env@master
with:
php: '7.4'
active-theme: 'hello-elementor'
plugins: |-
./elementor
themes: |-
https://downloads.wordpress.org/theme/hello-elementor.zip
mappings: |-
elementor-templates:./tests/playwright/templates
- name: Import Templates
uses: elementor/elementor-editor-github-actions/actions/setup-elementor-env@master
with:
env: 'testing'
templates: |-
elementor-templates
- name: Install lhci
run: npm install --no-package-lock --no-save @lhci/cli@0.14.0
- name: Run Lighthouse tests
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/run-lighthouse-tests.sh"
- name: Save HTML dumps on failure
if: failure()
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/save-lighthouse-pages-html-dumps.sh"
- name: Upload Lighthouse reports on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: lighthouseci-reports
path: ${{ github.workspace }}/.lighthouseci/reports/**/*
retention-days: 7
- name: Upload Lighthouse HTML dumps on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: lighthouseci-htmls
path: ${{ github.workspace }}/.lighthouseci/dumps/**/*
retention-days: 7
lighthouse:
needs: lighthouse_test
if: ${{ always() }} # Will be run even if 'Lighthouse' matrix will be skipped
runs-on: ubuntu-22.04
name: Lighthouse - Test Results
steps:
- name: Test status
run: echo "Test status is - ${{ needs.lighthouse_test.result }}"
- name: Check lighthouse_test matrix status
if: ${{ needs.lighthouse_test.result != 'success' && needs.lighthouse_test.result != 'skipped' }}
run: exit 1