stages: - preparation - building - testing #- deployment default: image: thecodingmachine/php:8.2-v4-fpm-node18 services: - postgres:latest retry : 2 #.standard-rules: # This is a hidden job that contains the rules that are common to all jobs. # rules: # - if: $CI_PIPELINE_SOURCE == 'merge_request_event' # - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH variables: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: test POSTGRES_HOST_AUTH_METHOD: trust PHP_EXTENSIONS: intl pdo_pgsql pdo_sqlite gd cache: paths: - vendor/ - node_modules/ composer: # extends: .standard-rules stage: preparation script: - composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts - cp .env.ci.gl .env - php artisan key:generate - php artisan migrate artifacts: paths: - vendor/ - .env npm: # extends: .standard-rules stage: preparation script: - npm install artifacts: paths: - node_modules/ - public/ build_assets: # extends: .standard-rules stage: building dependencies: - npm script: - npm run build artifacts: paths: - public/ pest_tests: # extends: .standard-rules stage: testing dependencies: - composer - build_assets script: - php vendor/bin/pest --coverage-xml=pest-coverage-xml --log-junit=junit.xml artifacts: when: always paths: - junit.xml reports: junit: junit.xml end_to_end_tests: # extends: .standard-rules stage: testing image: chilio/laravel-dusk-ci:latest script: - php artisan dusk:chrome-driver --detect --verbose - configure-laravel - start-nginx-ci-project - chromedriver & - php artisan pest:dusk --without-tty artifacts: paths: - ./storage/logs # for debugging - ./tests/Browser/screenshots - ./tests/Browser/console expire_in: 7 days when: always static_analysis: # extends: .standard-rules stage: testing dependencies: - composer script: - php vendor/bin/phpstan analyse code_style: # extends: .standard-rules stage: testing dependencies: - composer script: - php vendor/bin/pint #send_to_staging: # stage: deployment # script: # - 'curl --fail --request POST --form token=$MY_TRIGGER_TOKEN --form ref=main "https://gitlab.example.com/api/v4/projects/123456/trigger/pipeline"' # rules: # - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH