aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2019-09-26 09:27:27 +0200
committerMichel Dänzer <[email protected]>2019-12-06 10:02:01 +0100
commit41797a1fed5ed9b7dafeeb064e47f1a364a4e981 (patch)
tree8ec2463ae75296a97bfe1f964cb0cc8510a3debe
parentebd1309fef98e03460cb0485d53cbbf8227f9c04 (diff)
gitlab-ci: Overhaul job run policy
Use new rules: instead of only: For container stage jobs: * In the main Mesa project, run them by default. * In merge requests, run them by default if any files affecting pipeline results are changed. * In all other cases (in particular branches in personal projects), don't run them by default but allow triggering them manually. build & test stage jobs are left at the default (when: on_success), so they will run automatically once all their dependencies are satisified. (Using the same rules as above would require these jobs to be manually triggered as well, which is only possible once all dependency jobs have passed) Please be considerate of CI runner resources and cancel unneeded jobs on personal branches with no corresponding merge requests (this can be done before the jobs start running). In summary: No more special branch names. Unnecessary job runs are avoided by default, but jobs which don't run by default can be triggered manually. v2: * Split out LAVA changes to separate commit * Clarify commit log a little, in particular WRT build/test stage jobs Reviewed-by: Samuel Pitoiset <[email protected]> # v1 Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> # v1 Reviewed-by: Tomeu Vizoso <[email protected]> # v1 Acked-by: Eric Engestrom <[email protected]>
-rw-r--r--.gitlab-ci.yml50
1 files changed, 28 insertions, 22 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 0c89ec45a2a..9934293b2df 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -18,28 +18,8 @@ stages:
# When to automatically run the CI
.ci-run-policy:
- only:
- refs:
- - branches@mesa/mesa
- - merge_requests
- - /^ci([-/].*)?$/
- changes:
- - VERSION
- - bin/**/*
- # GitLab CI
- - .gitlab-ci.yml
- - .gitlab-ci/**/*
- # Meson
- - meson*
- - build-support/**/*
- - subprojects/**/*
- # SCons
- - SConstruct
- - scons/**/*
- - common.py
- # Source code
- - include/**/*
- - src/**/*
+ rules:
+ - when: on_success
retry:
max: 2
when:
@@ -77,6 +57,32 @@ stages:
stage: container
extends:
- .ci-run-policy
+ rules:
+ # Run pipeline by default for merge requests changing files affecting it
+ - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == $CI_COMMIT_REF_NAME'
+ changes:
+ - VERSION
+ - bin/**/*
+ # GitLab CI
+ - .gitlab-ci.yml
+ - .gitlab-ci/**/*
+ # Meson
+ - meson*
+ - build-support/**/*
+ - subprojects/**/*
+ # SCons
+ - SConstruct
+ - scons/**/*
+ - common.py
+ # Source code
+ - include/**/*
+ - src/**/*
+ when: on_success
+ # Always run pipeline by default in the main project
+ - if: '$CI_PROJECT_PATH == "mesa/mesa"'
+ when: on_success
+ # Otherwise, allow triggering jobs manually
+ - when: manual
variables:
DEBIAN_VERSION: buster-slim
REPO_SUFFIX: $CI_JOB_NAME