Skip to content

Commit 6cef674

Browse files
committed
Added checks for codeception and phpcs to run tests or code quality
1 parent f5c5966 commit 6cef674

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

.github/workflows/code-quality.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ jobs:
2626
plugin=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep '^plugins/' | head -1 | cut -d/ -f2)
2727
echo "slug=$plugin" >> $GITHUB_OUTPUT
2828
29+
# We should at least have a phpcs.xml file to run code quality checks
30+
- name: Validate phpcs.xml
31+
run: |
32+
if [ ! -f "plugins/${{ steps.plugin.outputs.slug }}/phpcs.xml" ]; then
33+
echo "Exiting as no phpcs.xml file found for /${{ steps.plugin.outputs.slug }}"
34+
exit 1
35+
fi
36+
2937
- name: PHP Code Quality
3038
uses: ./.github/actions/code-quality
3139
with:

.github/workflows/codeception.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,18 @@ jobs:
4343
plugin=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep '^plugins/' | head -1 | cut -d/ -f2)
4444
echo "slug=$plugin" >> $GITHUB_OUTPUT
4545
46+
- name: Validate codeception.dist.yml
47+
run: |
48+
if [ ! -f "plugins/${{ steps.plugin.outputs.slug }}/codeception.dist.yml" ]; then
49+
echo "Exiting as no codeception file found for this plugin - /${{ steps.plugin.outputs.slug }}"
50+
exit 1
51+
fi
52+
4653
- name: Validate composer.json
4754
run: |
4855
if [ ! -f "plugins/${{ steps.plugin.outputs.slug }}/composer.json" ]; then
49-
echo "Warning: composer.json missing in plugins/${{ steps.plugin.outputs.slug }}"
56+
echo "Exiting as no composer file found for this plugin - ${{ steps.plugin.outputs.slug }}"
57+
exit 1
5058
fi
5159
5260
- name: Run Codeception Tests

0 commit comments

Comments
 (0)