Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .ahoy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,13 @@ commands:
cmd: ahoy cli php -d memory_limit=-1 vendor/bin/behat --colors "$@"
#;> TOOL_BEHAT

#;< LIGHTHOUSE
test-lighthouse:
usage: Run Lighthouse performance, accessibility, best practices and SEO audits. Pass paths to audit them instead of the configured pages.
aliases: [lighthouse]
cmd: docker compose run --rm $(env | cut -f1 -d= | grep -E '^(TERM|LOCALDEV_URL)$|^(COMPOSE|DOCKER|DRUPAL|VORTEX|ENVIRONMENT)_' | sed 's/^/-e /') lighthouse ./vendor/bin/vortex-lighthouse "$@"
#;> LIGHTHOUSE

debug:
usage: Enable PHP Xdebug.
aliases: [xdebug]
Expand Down
14 changes: 14 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,9 @@ jobs:
# catch-all profile.
echo "export VORTEX_CI_BEHAT_PROFILE_OFFSET=0"
#;> TOOL_BEHAT
#;< LIGHTHOUSE
echo "export VORTEX_CI_IS_LIGHTHOUSE_RUNNER=$([ "${CIRCLE_NODE_INDEX:-0}" -eq 0 ] && echo 1 || echo 0)"
#;> LIGHTHOUSE
} >> "${BASH_ENV}"

- run:
Expand Down Expand Up @@ -597,6 +600,17 @@ jobs:
no_output_timeout: 30m
#;> TOOL_BEHAT

#;< LIGHTHOUSE
# Advisory unless VORTEX_CI_LIGHTHOUSE_IGNORE_FAILURE is set to 0.
- run:
name: Audit with Lighthouse
command: |
[ "${VORTEX_CI_IS_LIGHTHOUSE_RUNNER:-1}" = "1" ] || exit 0
[ "${VORTEX_CI_LIGHTHOUSE_SKIP:-0}" = "1" ] && exit 0
docker compose run --rm -T lighthouse ./vendor/bin/vortex-lighthouse || [ "${VORTEX_CI_LIGHTHOUSE_IGNORE_FAILURE:-1}" -eq 1 ]
no_output_timeout: 30m
#;> LIGHTHOUSE

- run:
name: Process test logs and artifacts
command: |
Expand Down
14 changes: 14 additions & 0 deletions .circleci/vortex-test-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@ jobs:
# catch-all profile.
echo "export VORTEX_CI_BEHAT_PROFILE_OFFSET=0"
#;> TOOL_BEHAT
#;< LIGHTHOUSE
echo "export VORTEX_CI_IS_LIGHTHOUSE_RUNNER=$([ "${CIRCLE_NODE_INDEX:-0}" -eq 0 ] && echo 1 || echo 0)"
#;> LIGHTHOUSE
} >> "${BASH_ENV}"

- run:
Expand Down Expand Up @@ -396,6 +399,17 @@ jobs:
no_output_timeout: 30m
#;> TOOL_BEHAT

#;< LIGHTHOUSE
# Advisory unless VORTEX_CI_LIGHTHOUSE_IGNORE_FAILURE is set to 0.
- run:
name: Audit with Lighthouse
command: |
[ "${VORTEX_CI_IS_LIGHTHOUSE_RUNNER:-1}" = "1" ] || exit 0
[ "${VORTEX_CI_LIGHTHOUSE_SKIP:-0}" = "1" ] && exit 0
docker compose run --rm -T lighthouse ./vendor/bin/vortex-lighthouse || [ "${VORTEX_CI_LIGHTHOUSE_IGNORE_FAILURE:-1}" -eq 1 ]
no_output_timeout: 30m
#;> LIGHTHOUSE

- run:
name: Process test logs and artifacts
command: |
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/build-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,9 @@ jobs:
# first Behat instance still selects the `p0` catch-all profile.
VORTEX_CI_BEHAT_PROFILE_OFFSET: 0
#;> TOOL_BEHAT
#;< LIGHTHOUSE
VORTEX_CI_IS_LIGHTHOUSE_RUNNER: ${{ matrix.instance == 0 || strategy.job-total == 1 }}
#;> LIGHTHOUSE

container:
# https://hub.docker.com/r/drevops/ci-runner
Expand Down Expand Up @@ -645,6 +648,19 @@ jobs:
timeout-minutes: 30
#;> TOOL_BEHAT

#;< LIGHTHOUSE
# Advisory unless VORTEX_CI_LIGHTHOUSE_IGNORE_FAILURE is set to 0.
- name: Audit with Lighthouse
if: ${{ env.VORTEX_CI_IS_LIGHTHOUSE_RUNNER == 'true' && vars.VORTEX_CI_LIGHTHOUSE_SKIP != '1' }}
run: |
status=0
docker compose run --rm -T lighthouse ./vendor/bin/vortex-lighthouse || status=$?
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
docker compose exec -T cli cat "${VORTEX_LIGHTHOUSE_REPORT_DIR:-.logs/lighthouse}/summary.md" >> "${GITHUB_STEP_SUMMARY}" 2>/dev/null || true
exit "${status}"
continue-on-error: ${{ vars.VORTEX_CI_LIGHTHOUSE_IGNORE_FAILURE != '0' }}
timeout-minutes: 30
#;> LIGHTHOUSE

- name: Process test logs and artifacts
if: always()
run: |
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/vortex-test-didi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@ jobs:
# first Behat instance still selects the `p0` catch-all profile.
VORTEX_CI_BEHAT_PROFILE_OFFSET: 0
#;> TOOL_BEHAT
#;< LIGHTHOUSE
VORTEX_CI_IS_LIGHTHOUSE_RUNNER: ${{ matrix.instance == 0 || strategy.job-total == 1 }}
#;> LIGHTHOUSE

container:
# https://hub.docker.com/r/drevops/ci-runner
Expand Down Expand Up @@ -494,6 +497,19 @@ jobs:
timeout-minutes: 30
#;> TOOL_BEHAT

#;< LIGHTHOUSE
# Advisory unless VORTEX_CI_LIGHTHOUSE_IGNORE_FAILURE is set to 0.
- name: Audit with Lighthouse
if: ${{ env.VORTEX_CI_IS_LIGHTHOUSE_RUNNER == 'true' && vars.VORTEX_CI_LIGHTHOUSE_SKIP != '1' }}
run: |
status=0
docker compose run --rm -T lighthouse ./vendor/bin/vortex-lighthouse || status=$?
docker compose exec -T cli cat "${VORTEX_LIGHTHOUSE_REPORT_DIR:-.logs/lighthouse}/summary.md" >> "${GITHUB_STEP_SUMMARY}" 2>/dev/null || true
exit "${status}"
continue-on-error: ${{ vars.VORTEX_CI_LIGHTHOUSE_IGNORE_FAILURE != '0' }}
timeout-minutes: 30
#;> LIGHTHOUSE

- name: Process test logs and artifacts
if: always()
run: |
Expand Down Expand Up @@ -770,6 +786,9 @@ jobs:
# first Behat instance still selects the `p0` catch-all profile.
VORTEX_CI_BEHAT_PROFILE_OFFSET: 0
#;> TOOL_BEHAT
#;< LIGHTHOUSE
VORTEX_CI_IS_LIGHTHOUSE_RUNNER: ${{ matrix.instance == 0 || strategy.job-total == 1 }}
#;> LIGHTHOUSE

container:
# https://hub.docker.com/r/drevops/ci-runner
Expand Down Expand Up @@ -1018,6 +1037,19 @@ jobs:
timeout-minutes: 30
#;> TOOL_BEHAT

#;< LIGHTHOUSE
# Advisory unless VORTEX_CI_LIGHTHOUSE_IGNORE_FAILURE is set to 0.
- name: Audit with Lighthouse
if: ${{ env.VORTEX_CI_IS_LIGHTHOUSE_RUNNER == 'true' && vars.VORTEX_CI_LIGHTHOUSE_SKIP != '1' }}
run: |
status=0
docker compose run --rm -T lighthouse ./vendor/bin/vortex-lighthouse || status=$?
docker compose exec -T cli cat "${VORTEX_LIGHTHOUSE_REPORT_DIR:-.logs/lighthouse}/summary.md" >> "${GITHUB_STEP_SUMMARY}" 2>/dev/null || true
exit "${status}"
continue-on-error: ${{ vars.VORTEX_CI_LIGHTHOUSE_IGNORE_FAILURE != '0' }}
timeout-minutes: 30
#;> LIGHTHOUSE

- name: Process test logs and artifacts
if: always()
run: |
Expand Down
6 changes: 6 additions & 0 deletions .vortex/docs/.utils/variables/extra/ci.variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ VORTEX_CI_BEHAT_PROFILE=
# Ignore Jest test failures.
VORTEX_CI_JEST_IGNORE_FAILURE=0

# Ignore Lighthouse audit failures. Set to 0 to fail the build when a score is below its budget.
VORTEX_CI_LIGHTHOUSE_IGNORE_FAILURE=1

# Skip the Lighthouse audit.
VORTEX_CI_LIGHTHOUSE_SKIP=0

# Ignore working tree check failures.
VORTEX_CI_WORKTREE_CHANGES_IGNORE_FAILURE=0

Expand Down
1 change: 1 addition & 0 deletions .vortex/docs/.vale/Vortex/Headings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ exceptions+:
- SDC Devel
- Security Kit
- SemVer
- SEO
- Single Directory Components
- SSH
- Stage File Proxy
Expand Down
1 change: 1 addition & 0 deletions .vortex/docs/content/continuous-integration/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,7 @@ The following table lists the variable for each tool:
| [Gitleaks](../development/security/secret-scanning.mdx) | Scan the codebase for committed secrets | `VORTEX_CI_GITLEAKS_IGNORE_FAILURE` |
| [Hadolint](../development/code-quality/hadolint.mdx) | Lint Dockerfiles for best practices | `VORTEX_CI_HADOLINT_IGNORE_FAILURE` |
| [Jest](../development/testing/jest.mdx) | Run JavaScript unit tests | `VORTEX_CI_JEST_IGNORE_FAILURE` |
| [Lighthouse](../development/testing/lighthouse.mdx) | Compare page scores with budgets (defaults to `1`, set `0` to block) | `VORTEX_CI_LIGHTHOUSE_IGNORE_FAILURE` |
| [npm security audit](../development/security/dependency-audit.mdx#javascript-dependencies) | Check JavaScript dependencies for vulnerabilities | `VORTEX_CI_NPM_AUDIT_IGNORE_FAILURE` |
| [PHPCS](../development/code-quality/phpcs.mdx) | Check PHP coding standards | `VORTEX_CI_PHPCS_IGNORE_FAILURE` |
| [PHPStan](../development/code-quality/phpstan.mdx) | Analyze PHP code statically | `VORTEX_CI_PHPSTAN_IGNORE_FAILURE` |
Expand Down
4 changes: 4 additions & 0 deletions .vortex/docs/content/development/testing/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ soon as you push it. Each framework covers a different layer of the site:
Write tests](behat.mdx#write-tests) and [Jest > Test file
structure](jest.mdx#test-file-structure) for where a new test goes.

An optional [Lighthouse](lighthouse.mdx) audit scores pages for
performance, accessibility, best practices and SEO with
`ahoy test-lighthouse`.

## Run the tests

Run the tests with the following Ahoy commands:
Expand Down
Loading
Loading