|
| 1 | +# CorePHP — the gate. |
| 2 | +# |
| 3 | +# Before this file the project had no CI config of its own and inherited a |
| 4 | +# group pipeline whose build and code_intelligence jobs exit 127 on every |
| 5 | +# commit: nothing to build, nothing to index. Pipeline 795 was the first this |
| 6 | +# project ever completed, and it could not have passed. With |
| 7 | +# only_allow_merge_if_pipeline_succeeds on, that made every merge request |
| 8 | +# unmergeable for a reason unrelated to its contents. |
| 9 | +# |
| 10 | +# So the gate is defined here, and it gates on things that are true. |
| 11 | + |
| 12 | +stages: |
| 13 | + - gate |
| 14 | + - report |
| 15 | + |
| 16 | +default: |
| 17 | + interruptible: true |
| 18 | + |
| 19 | +variables: |
| 20 | + COMPOSER_NO_INTERACTION: "1" |
| 21 | + # Deep enough that the merge-request diff base is present in the clone; |
| 22 | + # without it the style check silently degrades to a whole-repo scan. |
| 23 | + GIT_DEPTH: "50" |
| 24 | + |
| 25 | +# The runner is a shell executor on the homelab box, so `image:` would be |
| 26 | +# silently ignored and the script runs directly on the host. That host already |
| 27 | +# provides PHP 8.5 and Composer; installing a toolchain here fails on |
| 28 | +# permissions and is not needed. |
| 29 | +.php: |
| 30 | + before_script: |
| 31 | + - php -v | head -1 |
| 32 | + - composer install --no-progress --prefer-dist |
| 33 | + |
| 34 | +# Must be true for the change to land. |
| 35 | +gate: |
| 36 | + extends: .php |
| 37 | + stage: gate |
| 38 | + rules: |
| 39 | + - if: $CI_PIPELINE_SOURCE == "merge_request_event" |
| 40 | + - if: $CI_COMMIT_BRANCH |
| 41 | + script: |
| 42 | + # Every PHP file parses. |
| 43 | + - find src tests -name '*.php' -print0 | xargs -0 -n1 -P4 php -l > /dev/null |
| 44 | + # House style, whole tree. The tree was formatted in one pass so this |
| 45 | + # needs no changed-files logic — which is the point: computing "what did |
| 46 | + # this change touch" in CI went wrong three separate ways (a stale |
| 47 | + # merge-request diff base after a force-push, a shallow clone with no real |
| 48 | + # merge base, and a whitespace-only file list that made pint silently scan |
| 49 | + # everything). None of that can happen to `pint --test`. |
| 50 | + - ./vendor/bin/pint --test |
| 51 | + # The package-level suite. This one is green and must stay green. |
| 52 | + - ./vendor/bin/pest --testsuite=Feature,Unit --no-coverage |
| 53 | + |
| 54 | +# Reports, does not block. |
| 55 | +# |
| 56 | +# The suites under src/ were dark until they were wired into phpunit.xml, and |
| 57 | +# turning them on surfaced ~448 pre-existing failures: missing test-database |
| 58 | +# migrations, classes referenced from sibling packages that CorePHP does not |
| 59 | +# depend on, and genuine assertion drift. That debt is real and worth seeing on |
| 60 | +# every pipeline, but it predates any single change and blocking on it would |
| 61 | +# stop all work rather than fix it. |
| 62 | +# |
| 63 | +# This is deliberately NOT `|| true` on the gate job — a check that silently |
| 64 | +# passes teaches you nothing. It is a separate job, allowed to fail, so the |
| 65 | +# number is visible and can be driven down. When it reaches zero, move the |
| 66 | +# --testsuite line above to cover src too and delete this job. |
| 67 | +module-suite-debt: |
| 68 | + extends: .php |
| 69 | + stage: report |
| 70 | + allow_failure: true |
| 71 | + rules: |
| 72 | + - if: $CI_PIPELINE_SOURCE == "merge_request_event" |
| 73 | + - if: $CI_COMMIT_BRANCH |
| 74 | + script: |
| 75 | + - ./vendor/bin/pest --testsuite=Module --no-coverage |
0 commit comments