From 121510315b66a35979633713119b6a0e15d3efba Mon Sep 17 00:00:00 2001 From: Brian Henry Date: Thu, 9 May 2024 10:19:19 -0700 Subject: [PATCH] In its own step, determine if no module Cypress tests found --- .github/workflows/module-plugin-test.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/module-plugin-test.yml b/.github/workflows/module-plugin-test.yml index 9ba0dab..b5a55c0 100644 --- a/.github/workflows/module-plugin-test.yml +++ b/.github/workflows/module-plugin-test.yml @@ -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