stages:
  - test
  - build

include:
  - template: Composer.gitlab-ci.yml

# Select what we should cache between builds
cache:
  paths:
    - vendor/
    - tools/

# Run our tests
# If Xdebug was installed you can generate a coverage report and see code coverage metrics.
test:
  image: registry.gitlab.com/stella-maris/php-containers/php8.1
  before_script:
    - phive install --trust-gpg-keys 0x4AA394086372C20A,0x12CE0F1D262429A5,0x31C7E470E2138192
    - composer install
  script:
    - tools/phpunit --configuration phpunit.xml.dist

# Publish composer package to the GitLab package registry
# Extends the default GitLab template located at https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Composer.gitlab-ci.yml
publish:
  only:
    - tags
