OSDN Git Service

gitlab: convert static checks to .base_job_template
[qmiga/qemu.git] / .gitlab-ci.d / base.yml
1
2 # The order of rules defined here is critically important.
3 # They are evaluated in order and first match wins.
4 #
5 # Thus we group them into a number of stages, ordered from
6 # most restrictive to least restrictive
7 #
8 .base_job_template:
9   rules:
10     #############################################################
11     # Stage 1: exclude scenarios where we definitely don't
12     # want jobs to run
13     #############################################################
14
15     # Cirrus jobs can't run unless the creds / target repo are set
16     - if: '$QEMU_JOB_CIRRUS && ($CIRRUS_GITHUB_REPO == "" || $CIRRUS_API_TOKEN == "")'
17       when: never
18
19     # Jobs only intended for forks should always be skipped on upstream
20     - if: '$QEMU_JOB_ONLY_FORKS == "1" && $CI_PROJECT_NAMESPACE == "qemu-project"'
21       when: never
22
23
24     #############################################################
25     # Stage 2: fine tune execution of jobs in specific scenarios
26     # where the catch all logic is inapprorpaite
27     #############################################################
28
29     # Optional jobs should not be run unless manually triggered
30     - if: '$QEMU_JOB_OPTIONAL'
31       when: manual
32       allow_failure: true
33
34
35     #############################################################
36     # Stage 3: catch all logic applying to any job not matching
37     # an earlier criteria
38     #############################################################
39
40     # Jobs can run if any jobs they depend on were successfull
41     - when: on_success