Skip to content

Commit ab74564

Browse files
author
Timothy Elias
committed
[FEATURE] Run GrumPHP inside PHP docker container
1 parent 152ad69 commit ab74564

3 files changed

Lines changed: 26 additions & 1 deletion

File tree

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s composerValidate
2525

2626
- name: GrumPHP
27-
run: .Build/vendor/phpro/grumphp/bin/grumphp run
27+
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s grumphp
2828

2929
- name: Lint PHP
3030
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s lint

Build/Scripts/runTests.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Options:
4747
- composerInstallMax: "composer update", with no platform.php config.
4848
- composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0.
4949
- composerValidate: "composer validate"
50+
- grumphp: "GrumPHP run"
5051
- lint: PHP linting
5152
- unit (default): PHP unit tests
5253
- functional: functional tests
@@ -257,6 +258,12 @@ case ${TEST_SUITE} in
257258
esac
258259
docker compose down
259260
;;
261+
grumphp)
262+
setUpDockerComposeDotEnv
263+
docker compose run grumphp
264+
SUITE_EXIT_CODE=$?
265+
docker compose down
266+
;;
260267
lint)
261268
setUpDockerComposeDotEnv
262269
docker compose run lint

Build/testing-docker/docker-compose.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,24 @@ services:
272272
fi
273273
"
274274
275+
grumphp:
276+
image: ghcr.io/typo3/core-testing-${DOCKER_PHP_IMAGE}:latest
277+
user: ${HOST_UID}
278+
volumes:
279+
- ${ROOT_DIR}:${ROOT_DIR}
280+
- ${HOST_HOME}:${HOST_HOME}
281+
- /etc/passwd:/etc/passwd:ro
282+
- /etc/group:/etc/group:ro
283+
working_dir: ${ROOT_DIR}
284+
command: >
285+
/bin/sh -c "
286+
if [ ${SCRIPT_VERBOSE} -eq 1 ]; then
287+
set -x
288+
fi
289+
php -v | grep '^PHP';
290+
.Build/vendor/phpro/grumphp/bin/grumphp run;
291+
"
292+
275293
lint:
276294
image: ghcr.io/typo3/core-testing-${DOCKER_PHP_IMAGE}:latest
277295
user: ${HOST_UID}

0 commit comments

Comments
 (0)