Skip to content

Commit c840519

Browse files
committed
workflow
1 parent 4b9d0fd commit c840519

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

.github/workflows/check-files.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,14 @@ on:
3434
description: "Count changed PHPStan files"
3535
value: ${{ jobs.check.outputs.phpstan }}
3636
phpunit-test:
37-
description: "Count changed PhpUnit test files"
37+
description: "Count changed PHPUnit test files"
3838
value: ${{ jobs.check.outputs.phpunit-test }}
3939
phpunit:
40-
description: "Count changed PhpUnit files"
40+
description: "Count changed PHPUnit files"
4141
value: ${{ jobs.check.outputs.phpunit }}
42+
cypress:
43+
description: "Count changed Cypress files"
44+
value: ${{ jobs.check.outputs.cypress }}
4245
# Allow manually triggering the workflow.
4346
workflow_dispatch:
4447

@@ -59,6 +62,7 @@ jobs:
5962
phpstan: ${{ steps.changes-phpstan.outputs.phpstan }}
6063
phpunit-test: ${{ steps.changes-phpunit-test.outputs.phpunit-test }}
6164
phpunit: ${{ steps.changes-phpunit.outputs.phpunit }}
65+
cypress: ${{ steps.changes-cypress.outputs.cypress }}
6266

6367
steps:
6468
- name: Checkout code
@@ -194,3 +198,11 @@ jobs:
194198
count="$(grep -oE "**phpunit**" <<< "${{ steps.changed-files-specific.outputs.all_modified_files }}" | wc -l)"
195199
echo "$count PHPUnit file(s) changed"
196200
echo "phpunit=$count" >> $GITHUB_OUTPUT
201+
202+
- name: Check if Cypress files changed
203+
id: changes-cypress
204+
if: steps.changed-files-specific.outputs.any_modified == 'true'
205+
run: |
206+
count="$(grep -oE "cypress/" <<< "${{ steps.changed-files-specific.outputs.all_modified_files }}" | wc -l)"
207+
echo "$count Cypress file(s) changed"
208+
echo "cypress=$count" >> $GITHUB_OUTPUT

.github/workflows/workflow.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,23 @@ jobs:
127127
needs.check.outputs.workflow > 0
128128
uses: ./.github/workflows/rector.yml
129129

130-
# DOES NOT run by default
131-
# runs on schedule or when workflow or unit tests changed
132130
unit_tests:
133-
name: Unit Tests (OpenMage)
131+
name: PHPUnit Tests
134132
needs: [check, php-cs-fixer]
135133
if: |
136134
needs.check.outputs.php > 0 ||
137135
needs.check.outputs.phpunit-test > 0 ||
138136
needs.check.outputs.phpunit > 0 ||
139137
needs.check.outputs.workflow > 0
140138
uses: ./.github/workflows/phpunit.yml
139+
140+
cypress:
141+
name: Cypress E2E Tests
142+
needs: [check, php-cs-fixer]
143+
if: |
144+
needs.check.outputs.cypress > 0 ||
145+
needs.check.outputs.php > 0 ||
146+
needs.check.outputs.phtml > 0 ||
147+
needs.check.outputs.xml > 0 ||
148+
needs.check.outputs.workflow > 0
149+
uses: ./.github/workflows/cypress.yml

0 commit comments

Comments
 (0)