Skip to content

Commit c8db08b

Browse files
committed
Run sniffs against production files.
1 parent 4600951 commit c8db08b

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

.github/workflows/php-compat.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,18 @@ jobs:
2727
# In order to ensure PHP Compatibility, the build step must be run in order to ensure all
2828
# files in the production release of the plugin are compatible with the target PHP versions.
2929
- name: Build production bundle
30-
run: npm run build:webpack
30+
run: npm run build
3131

32-
# The PHP Compatibility sniffs need to include the vendor directory to ensure all files
33-
# in the production release of the plugin are compatible with the target PHP versions.
34-
- name: Install composer production dependencies
35-
run: composer install --no-dev --prefer-dist --optimize-autoloader
32+
# Unzip the newly created zip file to a separate directory.
33+
- name: Unzip production bundle
34+
run: |
35+
cd ~
36+
mkdir prod
37+
unzip woocommerce-square.zip -d prod
38+
cd -
39+
40+
- name: Copy phpcompat sniffs to production directory
41+
run: cp phpcs-compat.xml.dist ~/prod/woocommerce-square/phpcs-compat.xml.dist
3642

3743
# Installed globally to ensure dev dependencies are not included in compatibility sniffs.
3844
# At the time of writing no production version of PHPCompatibility/PHP-Compatibility supports
@@ -44,4 +50,6 @@ jobs:
4450
composer global require --dev phpcompatibility/php-compatibility:dev-develop#8daeec54772a592ad369be23ae02ed593c71e7f1
4551
4652
- name: Run PHPCompatibility on all files
47-
run: ~/.composer/vendor/bin/phpcs . --standard=phpcs-compat.xml.dist -q --report=checkstyle | cs2pr
53+
run: |
54+
cd ~/prod
55+
~/.composer/vendor/bin/phpcs . --standard=phpcs-compat.xml.dist -q --report=checkstyle | cs2pr

0 commit comments

Comments
 (0)