ci: skip containers & build jobs when disabling a farm

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25032>
This commit is contained in:
Eric Engestrom 2023-09-04 12:40:18 +01:00 committed by Alyssa Rosenzweig
parent 83cb5c3491
commit 7cf13ea504
2 changed files with 40 additions and 1 deletions

View File

@ -173,8 +173,9 @@ stages:
# Source code
- include/**/*
- src/**/*
- .ci-farms/*
when: on_success
# Run when re-enabling a disabled farm, but not when disabling it
- !reference [.re-enable-farm-rules, rules]
# Otherwise, build/test jobs won't run because no rule matched.
@ -199,6 +200,8 @@ stages:
- .gitlab-ci.yml
- .gitlab-ci/**/*
when: on_success
# Run when re-enabling a disabled farm, but not when disabling it
- !reference [.re-enable-farm-rules, rules]
# Run pipeline by default if it was triggered by Marge Bot, is for a
# merge request, and any files affecting the pipeline were changed
- if: *is-pre-merge-for-marge

View File

@ -239,3 +239,39 @@
when: never
- !reference [.freedreno-farm-rules, rules]
# Skip container & build jobs when disabling any farm, and run them if any farm
# gets re-enabled.
.re-enable-farm-rules:
rules:
# changes(disabled) + exists(disabled) = disabling the farm
- changes: [ .ci-farms-disabled/microsoft ]
exists: [ .ci-farms-disabled/microsoft ]
when: never
- changes: [ .ci-farms-disabled/collabora ]
exists: [ .ci-farms-disabled/collabora ]
when: never
- changes: [ .ci-farms-disabled/igalia ]
exists: [ .ci-farms-disabled/igalia ]
when: never
- changes: [ .ci-farms-disabled/lima ]
exists: [ .ci-farms-disabled/lima ]
when: never
- changes: [ .ci-farms-disabled/anholt ]
exists: [ .ci-farms-disabled/anholt ]
when: never
- changes: [ .ci-farms-disabled/valve-mupuf ]
exists: [ .ci-farms-disabled/valve-mupuf ]
when: never
- changes: [ .ci-farms-disabled/valve-kws ]
exists: [ .ci-farms-disabled/valve-kws ]
when: never
- changes: [ .ci-farms-disabled/austriancoder ]
exists: [ .ci-farms-disabled/austriancoder ]
when: never
- changes: [ .ci-farms-disabled/freedreno ]
exists: [ .ci-farms-disabled/freedreno ]
when: never
# Any other change to ci-farms-disabled/* means some farm is getting re-enabled
- changes: [ .ci-farms-disabled/* ]
when: on_success