Skip to content

Commit 2718f83

Browse files
committed
Added unit tests to the result of the build script.
1 parent 8ed2bf6 commit 2718f83

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed

.github/workflows/php_unit.yml

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
- '8.2'
2929
- '8.3'
3030
- '8.4'
31+
- '8.5'
3132
wordpress:
3233
- '6.5'
3334
- '6.7'
@@ -76,4 +77,50 @@ jobs:
7677
- name: Running unit tests
7778
run: |
7879
set -o pipefail
79-
npm run test
80+
npm run test
81+
82+
# ------------------------------------------------ #
83+
# Build Plugin and Run Tests on Built Distribution #
84+
# ------------------------------------------------ #
85+
86+
- name: Stop Docker environment
87+
# Remove this check when https://github.com/humbug/php-scoper/issues/1139 is resolved.
88+
if: matrix.php != '8.5'
89+
run: npm run wp-env stop
90+
91+
- name: Build Plugin
92+
if: matrix.php != '8.5'
93+
run: bin/build.sh
94+
95+
- name: Copy Test Files
96+
if: matrix.php != '8.5'
97+
run: |
98+
cp .wp-env.json dist/.wp-env.json
99+
cp package.json dist/package.json
100+
cp package-lock.json dist/package-lock.json
101+
cp phpcs.xml dist/phpcs.xml
102+
cp phpunit.xml dist/phpunit.xml
103+
cp -r tests dist/tests
104+
105+
- name: Install Dist Composer Dependencies
106+
if: matrix.php != '8.5'
107+
working-directory: dist
108+
run: composer install --no-interaction --no-progress --no-suggest --optimize-autoloader
109+
110+
- name: Start Dist Docker environment
111+
if: matrix.php != '8.5'
112+
working-directory: dist
113+
run: npm run wp-env start
114+
115+
- name: Log running Dist Docker containers
116+
if: matrix.php != '8.5'
117+
working-directory: dist
118+
run: docker ps -a
119+
120+
- name: Running Dist unit tests
121+
if: matrix.php != '8.5'
122+
working-directory: dist
123+
# We don't run phpcs here because the dist files are modified by the build script.
124+
run: |
125+
set -o pipefail
126+
npm run test:php

0 commit comments

Comments
 (0)