From 7cf13ea504e7e5be097e5f444843715d56c347b9 Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Mon, 4 Sep 2023 12:40:18 +0100 Subject: [PATCH] ci: skip containers & build jobs when disabling a farm Part-of: --- .gitlab-ci.yml | 5 ++++- .gitlab-ci/farm-rules.yml | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3541685113a..8beaf9cd74e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 diff --git a/.gitlab-ci/farm-rules.yml b/.gitlab-ci/farm-rules.yml index 4b31dbfe3f9..0f7cfae0eb9 100644 --- a/.gitlab-ci/farm-rules.yml +++ b/.gitlab-ci/farm-rules.yml @@ -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