Skip to content
Draft
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0875f0b
add parallel workflow
circlecube May 7, 2025
156272d
specify the test job needs the build job
circlecube May 7, 2025
1505e1f
also install dependencies again so we have wp-env available
circlecube May 7, 2025
2a57027
fix yml lint issues
circlecube May 7, 2025
5b59dfb
update artifact name and escape config override json
circlecube May 7, 2025
d357020
simplify wpenv override and plugin path
circlecube May 7, 2025
878276a
debug plugin dir
circlecube May 7, 2025
ec7636c
combine into one job so no need to pass build/artifact
circlecube May 7, 2025
8fe3d32
fix bad whtespace
circlecube May 7, 2025
7bd1fa6
remove job dependency
circlecube May 7, 2025
33c968e
split build and test into unique jobs
circlecube May 9, 2025
da56658
yml cleanup
circlecube May 9, 2025
48e3a44
fix wp-env install
circlecube May 9, 2025
a938988
let cypress action start wp-env
circlecube May 9, 2025
d3a3a10
run env start in own step
circlecube May 9, 2025
5b3e252
use cached dependencies between jobs
circlecube May 9, 2025
396debf
rearrange steps to be more consistent and remove duped step
circlecube May 9, 2025
25c428a
update screenshot name
circlecube May 9, 2025
fa2d879
more containers
circlecube May 9, 2025
5c902ce
try excluding onboarding tests
circlecube May 15, 2025
b9fed32
exclude full dir and wildcard glob
circlecube May 15, 2025
c1c5672
cleanup dependency caches
circlecube May 15, 2025
96e289d
rearrange test specs and add job to test onboarding only
circlecube May 15, 2025
367e62c
remove debug step and properly group parallel tests
circlecube May 15, 2025
6144c59
add publish-summary option to cypress runs
circlecube May 16, 2025
f66118f
Merge branch 'develop' into try/cypress-parallel
circlecube Jul 2, 2025
3a94227
remove onboarding exclusion and job
circlecube Jul 2, 2025
3e24d31
Merge branch 'develop' into try/cypress-parallel
circlecube Jul 18, 2025
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
203 changes: 203 additions & 0 deletions .github/workflows/cypress-parallel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
name: Parallel Cypress Tests
on:
push:
branches:
- main
- master
- trunk
- develop
- release/*
- feature/*
- add/*
- update/*
- fix/*
- try/*
pull_request:
types: [opened, edited, reopened, ready_for_review]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
permissions:
pull-requests: write

Check failure

Code scanning / zizmor

overly broad permissions Error

overly broad permissions

jobs:
build:
name: Build Plugin
runs-on: ubuntu-24.04
outputs:
dist: ${{ steps.workflow.outputs.DIST }}
package: ${{ steps.workflow.outputs.PACKAGE }}
steps:

- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Comment on lines +33 to +34

Check warning

Code scanning / zizmor

credential persistence through GitHub Actions artifacts Warning

credential persistence through GitHub Actions artifacts

- name: Setup PHP
uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2.32.0
with:
php-version: '8.1'
coverage: none
tools: composer

- name: Setup Node.js
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
with:
node-version: 20.x

- name: Show versions
run: |
php --version
composer --version
node --version
npm --version

- name: Validate composer.json and composer.lock files
run: composer validate

- name: Install PHP Dependencies
uses: ramsey/composer-install@a2636af0004d1c0499ffca16ac0b4cc94df70565 # v3.1.0
with:
composer-options: "--no-dev --optimize-autoloader --verbose"

- name: Install JS Dependencies
run: npm ci --legacy-peer-deps

- name: Build JavaScript
run: npm run build

- name: Setup workflow context
id: workflow
working-directory: ${{ runner.temp }}
env:
REPO: ${{ github.repository }}
run: |
mkdir dist
echo "DIST=${PWD}/dist" >> $GITHUB_OUTPUT
echo "PACKAGE=bluehost-wordpress-plugin" >> $GITHUB_OUTPUT

- name: Create Distribution Copy
run: rsync -r --include-from=.distinclude --exclude-from=.distignore . ${{ steps.workflow.outputs.DIST }}/${{ steps.workflow.outputs.PACKAGE }}

Check failure

Code scanning / octoscan

Expression injection, "steps..outputs." is potentially untrusted. Error

Expression injection, "steps.**.outputs.**" is potentially untrusted.

Check notice

Code scanning / zizmor

code injection via template expansion Note

code injection via template expansion

Check notice

Code scanning / zizmor

code injection via template expansion Note

code injection via template expansion

- name: List Distribution Files
working-directory: ${{ steps.workflow.outputs.DIST }}

Check failure

Code scanning / octoscan

Expression injection, "steps..outputs." is potentially untrusted. Error

Expression injection, "steps.**.outputs.**" is potentially untrusted.
run: find .

- name: Upload distribution artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
path: ${{ steps.workflow.outputs.dist }}
name: ${{ steps.workflow.outputs.package }}

test:
name: Test (${{ matrix.containers }})
needs: build
runs-on: ubuntu-24.04
timeout-minutes: 20
strategy:
# when one test fails, DO NOT cancel the other
# containers, because this will kill Cypress processes
# leaving Cypress Cloud hanging ...
# https://github.com/cypress-io/github-action/issues/48
fail-fast: false
matrix:
# run 4 parallel containers to speed up the tests
# https://docs.cypress.io/guides/guides/parallelization#Parallelization
containers: [1, 2, 3, 4]
steps:

- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Comment on lines +109 to +110

Check warning

Code scanning / zizmor

credential persistence through GitHub Actions artifacts Warning

credential persistence through GitHub Actions artifacts

- name: Setup PHP
uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2.32.0
with:
php-version: '8.1'
coverage: none
tools: composer

- name: Setup Node.js
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
with:
node-version: 20.x

- name: Show versions
run: |
php --version
composer --version
node --version
npm --version

- name: Validate composer.json and composer.lock files
run: composer validate

- name: Install PHP Dependencies
uses: ramsey/composer-install@a2636af0004d1c0499ffca16ac0b4cc94df70565 # v3.1.0
with:
composer-options: "--no-dev --optimize-autoloader --verbose"

- name: Install JS Dependencies
run: npm ci --legacy-peer-deps

- name: Setup workflow context
id: workflow
working-directory: ${{ runner.temp }}
env:
REPO: ${{ github.repository }}
run: |
mkdir dist
echo "DIST=${PWD}/dist" >> $GITHUB_OUTPUT

- name: Download plugin into dist directory
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
path: ${{ steps.workflow.outputs.DIST }}
name: ${{ needs.build.outputs.PACKAGE }}

- name: Configure WordPress
run: echo '{"plugins":["${{ steps.workflow.outputs.DIST }}/${{ needs.build.outputs.PACKAGE }}"]}' > .wp-env.override.json

Check failure

Code scanning / octoscan

Expression injection, "steps..outputs." is potentially untrusted. Error

Expression injection, "steps.**.outputs.**" is potentially untrusted.

Check notice

Code scanning / zizmor

code injection via template expansion Note

code injection via template expansion

Check notice

Code scanning / zizmor

code injection via template expansion Note

code injection via template expansion

- name: Start WordPress
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: 4
max_attempts: 3
command: npx wp-env start --debug

- name: Run Cypress Tests (Container ${{ matrix.containers }})
uses: cypress-io/github-action@0ee1130f05f69098ab5c560bd198fecf5a14d75b # v6.9.0
with:
record: true
parallel: true
group: parallel
publish-summary: true
tag: bluehost
# plugin tests, module tests, nested module tests
spec: |
tests/cypress/integration/**/*.cy.js
vendor/newfold-labs/**/tests/cypress/integration/*.cy.js
vendor/newfold-labs/**/tests/cypress/integration/**/*.cy.js
env:
# pass the Cypress Cloud record key as an environment variable
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# Recommended: pass the GitHub token lets this action correctly
# determine the unique run id necessary to re-run the checks
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Store screenshots of test failures
if: ${{ failure() }}
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
with:
path: ./tests/cypress/screenshots
name: ${{ needs.build.outputs.PACKAGE }}-${{ matrix.containers }}-screenshots

- name: Output debug.log file contents
if: ${{ always() }}
continue-on-error: true
run: npx wp-env run wordpress cat /var/www/html/wp-content/debug.log

- name: Output wordpress docker logs
if: always()
continue-on-error: true
run: |
npx wp-env logs --watch=false --debug=true
Loading