Quick start#
This quick start adds the php-test component to an app, the same way the
front page shows it. Every other component installs the same way: one
include, pinned to a commit SHA.
-
Check the requirements. Your GitLab must be 17.0 or newer (components are GA on the Free tier since GitLab 17.0), and the app must live on the same GitLab instance that hosts this project. Expected: both true, or the components cannot run here.
-
Add the include to the app's
.gitlab-ci.yml:include: - component: $CI_SERVER_FQDN/enterprise-apps/preflight/php-test@fb73b538f3980292119b5b306ff64383d760a214 # 0.9.0 inputs: test_command: vendor/bin/phpunitExpected: the file includes the component pinned to a full commit SHA, with the tag in a trailing comment. A tag or branch can move; a SHA cannot.
-
Commit and push the change:
git pushExpected: the next pipeline runs the
php-testjobs, one per entry ofphp_versions,8.3,8.4and8.5by default, each in theteststage. -
Read the result. Each job installs the app's dependencies, caches Composer downloads in
.composer-cache/, and runs the test command. Expected: a green matrix, meaning the app passes on every supported PHP version.
What you built#
Your app now runs the same PHP tests on each supported PHP version that every WSU app runs, from one pinned include. Add the remaining components the same way, one include each.
Next steps#
- Install: requirements, the full include, and how to verify.
- When the components run: the
workflow:rulesblock that keeps the checks on merge requests and the default branch. - The php-test component: inputs, caching, and trying the next PHP release without breaking the pipeline.
- Reference: every component, with its inputs and defaults.