Skip to content

Commit

Permalink
In its own step, determine if no module Cypress tests found
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHenryIE committed May 9, 2024
1 parent 2490bf1 commit 1215103
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/module-plugin-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,15 @@ jobs:
- name: Install WordPress
run: npx @wordpress/env@latest start --debug

- name: Check for module tests
id: check-for-module-tests
run:
if [[ $(find ./vendor/${{ inputs.module-repo }} -depth -name '*.cy*') ]]; then MODULE_TESTS_FOUND=1; else MODULE_TESTS_FOUND=0; fi
if [[ $MODULE_TESTS_FOUND -eq 0 ]]; then echo "No module Cypress tests found"; fi
echo "MODULE_TESTS_FOUND=$MODULE_TESTS_FOUND" >> $GITHUB_OUTPUT;

- name: Run Module Cypress Tests
if: $([[ ! $(find ./vendor/${{ inputs.module-repo }} -depth -name '*.cy*') ]])
if: ${{ steps.check-for-module-tests.outputs.MODULE_TESTS_FOUND }}
run: npm run test:e2e -- --browser chrome --spec "vendor/(${{ inputs.module-repo }}/**/*.cy.js)"

- name: Run Remaining Cypress Tests
Expand Down

0 comments on commit 1215103

Please sign in to comment.