1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Rules for where jobs can run
###
# Job variables:
# RUST_CI_RELEASE_ONLY
# Set to "true" to only perform for tag pipelines.
###
variables:
RUST_CI_PIPELINE_NAME: "rust-gitlab $CI_COMMIT_REF_NAME Pipeline"
# When to even consider running a pipeline.
workflow:
name: "${RUST_CI_PIPELINE_NAME}"
rules:
# Run for merge requests.
- if: '$CI_MERGE_REQUEST_ID'
when: always
auto_cancel:
# Cancel all pipeline jobs if a new commit comes in on the branch.
on_new_commit: interruptible
variables:
RUST_CI_PIPELINE_NAME: "rust-gitlab MR $CI_MERGE_REQUEST_IID Pipeline"
# Do not run for other projects.
- if: '$CI_PROJECT_PATH != "utils/rust-gitlab"'
when: never
# Run for schedules.
- if: '$CI_PIPELINE_SOURCE == "schedule"'
when: always
auto_cancel:
# Never cancel scheduled pipelines because of new commits.
on_new_commit: none
variables:
RUST_CI_PIPELINE_NAME: "rust-gitlab $CI_PIPELINE_SCHEDULE_DESCRIPTION Scheduled Pipeline"
# Run for protected branches.
- if: '$CI_COMMIT_REF_PROTECTED == "true"'
when: always
auto_cancel:
# Cancel all pipeline jobs if a new commit comes in on the branch.
on_new_commit: interruptible
variables:
RUST_CI_PIPELINE_NAME: "rust-gitlab Protected Pipeline for $CI_COMMIT_REF_NAME"
# Run for tags.
- if: '$CI_COMMIT_TAG'
when: always
variables:
RUST_CI_PIPELINE_NAME: "rust-gitlab Pipeline for tag $CI_COMMIT_TAG"
# Skip pipelines in all other cases.
- when: never
.rules:
rules:
# Run release-only jobs for tags.
- if: '$RUST_CI_RELEASE_ONLY == "true" && $CI_COMMIT_TAG'
when: on_success
# Skip release jobs without tag.
- if: '$RUST_CI_RELEASE_ONLY == "true"'
when: never
# Other jobs run right away.
- when: on_success