From 0795cd283d60592f4c45196d0397b59d231e6c81 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 23 May 2026 18:54:31 +0200 Subject: [PATCH] chore: add GitLab CI/CD pipeline with PHPStan, Pint, and PHPUnit --- .gitlab-ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..092ce3f --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,48 @@ +stages: + - validate + - test + +variables: + COMPOSER_ALLOW_SUPERUSER: "1" + +cache: + key: ${CI_COMMIT_REF_SLUG} + paths: + - vendor/ + - node_modules/ + +.php-base: + image: edgd1er/phpnt:8.4-laravel + before_script: + - apt-get update && apt-get install -y git unzip libpng-dev libjpeg-dev libfreetype6-dev 2>/dev/null || true + - docker-php-ext-install bcmath pdo_mysql gd 2>/dev/null || true + - cp .env.example .env || true + - composer install --prefer-dist --no-progress --no-interaction 2>&1 + +validate:phpstan: + stage: validate + extends: .php-base + script: + - vendor/bin/phpstan analyse --no-progress + allow_failure: false + +validate:pint: + stage: validate + extends: .php-base + script: + - vendor/bin/pint --test + allow_failure: false + +test:phpunit: + stage: test + extends: .php-base + script: + - php artisan key:generate --force + - vendor/bin/phpunit --log-junit junit.xml + artifacts: + reports: + junit: junit.xml + paths: + - junit.xml + when: always + allow_failure: false