Skip to content

GitLab Pipeline

Krzysztof Tomasz Zembrowski edited this page Mar 21, 2023 · 6 revisions

Make sure Pipelines are enabled in projects Settings > General > Visibility, project features, permissions > Repository > Pipelines.

Add .gitlab-ci.yml to your repository.

Example:

image: ghcr.io/rechtlogisch/php-with-ffi

stages:
  - test

test:
  stage: test
  cache:
    paths:
      - vendor/
  script:
    - composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
    - composer test

GitLab triggers Pipeline jobs on every push to the repository. You can adjust this behavior by adding only or rules in the .gitlab-ci.yml file (cf. GitLab Documentation)

To run tests with composer test add for example vendor/bin/pest to the scripts property of your composer.json (cf. Composer documentation and Pest PHP)

Clone this wiki locally