Loading jobs/phpunit_test/CHANGELOG.md +4 −0 Original line number Diff line number Diff line # Changelog All notable changes to this job will be documented in this file. ## [1.2.0] - 2023-04-03 * Change docker image to `bitnami/laravel` * Add `PHPUNIT_VERSION` variable ## [1.1.1] - 2023-02-28 * Fix broken documentation links Loading jobs/phpunit_test/README.md +2 −1 Original line number Diff line number Diff line Loading @@ -21,8 +21,9 @@ Using this job you'll be able to launch PHPUnit tests. | `PHPUNIT_COLORS` | Use colors in output | `never` | | `PHPUNIT_OPTIONS` | Custom user options for phpunit | ` ` | | `PHPUNIT_MEMORY_LIMIT` | Memory available for PHPUnit (see [more](#php-memory-limit)) | `512M` | | `PHPUNIT_VERSION` | PHPUnit version to install | `10.0.19` | | `PROJECT_ROOT` | PHP Project location | `/` | | `IMAGE_TAG` | The default tag for the docker image | `7.3` | | `IMAGE_TAG` | The default tag for the docker image | `9.5.2` | !!! note All paths defined in variables are starting from the root of your repository. Loading jobs/phpunit_test/phpunit_test.yml +8 −7 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ stages: - tests phpunit_test: image: lorisleiva/laravel-docker:${IMAGE_TAG} image: bitnami/laravel:${IMAGE_TAG} stage: tests variables: PHPUNIT_OUTPUT: "report_phpunit.xml" Loading @@ -12,15 +12,16 @@ phpunit_test: PHPUNIT_COLORS: "never" PHPUNIT_OPTIONS: "" PHPUNIT_MEMORY_LIMIT: "512M" PROJECT_ROOT: "/" IMAGE_TAG: "7.3" PHPUNIT_VERSION: "10.0.19" PROJECT_ROOT: "." IMAGE_TAG: "9.5.2" script: # Installing globally PHPUnit if not already - composer global require "phpunit/phpunit" # Install phpunit for the project - composer require --dev "phpunit/phpunit:${PHPUNIT_VERSION}" # Going to the root of php project - cd ${CI_PROJECT_DIR}${PROJECT_ROOT} - cd ${CI_PROJECT_DIR}/${PROJECT_ROOT} # Running Unit testing - phpunit \ - vendor/bin/phpunit \ -d memory_limit=${PHPUNIT_MEMORY_LIMIT} --configuration ${PHPUNIT_CONFIG_FILE} \ --coverage-text --colors=${PHPUNIT_COLORS} \ --log-junit ${CI_PROJECT_DIR}/${PHPUNIT_OUTPUT} ${PHPUNIT_OPTIONS} Loading Loading
jobs/phpunit_test/CHANGELOG.md +4 −0 Original line number Diff line number Diff line # Changelog All notable changes to this job will be documented in this file. ## [1.2.0] - 2023-04-03 * Change docker image to `bitnami/laravel` * Add `PHPUNIT_VERSION` variable ## [1.1.1] - 2023-02-28 * Fix broken documentation links Loading
jobs/phpunit_test/README.md +2 −1 Original line number Diff line number Diff line Loading @@ -21,8 +21,9 @@ Using this job you'll be able to launch PHPUnit tests. | `PHPUNIT_COLORS` | Use colors in output | `never` | | `PHPUNIT_OPTIONS` | Custom user options for phpunit | ` ` | | `PHPUNIT_MEMORY_LIMIT` | Memory available for PHPUnit (see [more](#php-memory-limit)) | `512M` | | `PHPUNIT_VERSION` | PHPUnit version to install | `10.0.19` | | `PROJECT_ROOT` | PHP Project location | `/` | | `IMAGE_TAG` | The default tag for the docker image | `7.3` | | `IMAGE_TAG` | The default tag for the docker image | `9.5.2` | !!! note All paths defined in variables are starting from the root of your repository. Loading
jobs/phpunit_test/phpunit_test.yml +8 −7 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ stages: - tests phpunit_test: image: lorisleiva/laravel-docker:${IMAGE_TAG} image: bitnami/laravel:${IMAGE_TAG} stage: tests variables: PHPUNIT_OUTPUT: "report_phpunit.xml" Loading @@ -12,15 +12,16 @@ phpunit_test: PHPUNIT_COLORS: "never" PHPUNIT_OPTIONS: "" PHPUNIT_MEMORY_LIMIT: "512M" PROJECT_ROOT: "/" IMAGE_TAG: "7.3" PHPUNIT_VERSION: "10.0.19" PROJECT_ROOT: "." IMAGE_TAG: "9.5.2" script: # Installing globally PHPUnit if not already - composer global require "phpunit/phpunit" # Install phpunit for the project - composer require --dev "phpunit/phpunit:${PHPUNIT_VERSION}" # Going to the root of php project - cd ${CI_PROJECT_DIR}${PROJECT_ROOT} - cd ${CI_PROJECT_DIR}/${PROJECT_ROOT} # Running Unit testing - phpunit \ - vendor/bin/phpunit \ -d memory_limit=${PHPUNIT_MEMORY_LIMIT} --configuration ${PHPUNIT_CONFIG_FILE} \ --coverage-text --colors=${PHPUNIT_COLORS} \ --log-junit ${CI_PROJECT_DIR}/${PHPUNIT_OUTPUT} ${PHPUNIT_OPTIONS} Loading