summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
authorJordan Petridis <jordan@centricular.com>2022-06-03 07:37:51 +0300
committerJordan Petridis <jordan@centricular.com>2022-06-03 07:37:51 +0300
commita026ae0101ef8a45c28de9edd4bcf3480db6aabf (patch)
tree1ba3c97b5e108a58b54e559867a2fd07690db0eb /.gitlab-ci.yml
parent0288390d4386ab24276af644dbfe666b8282ff97 (diff)
downloadat-spi2-core-a026ae0101ef8a45c28de9edd4bcf3480db6aabf.tar.gz
ci: Replace only/except with rules
Only/except is deprecated in favor of rules.
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml29
1 files changed, 13 insertions, 16 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 8f329289..0e240674 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -19,20 +19,21 @@ stages:
- docs
- deploy
-# Base definition for jobs.
-.only-default:
- only:
- - merge_requests
- - branches
- except:
- - tags
+# Enable merge request pipelines and avoid duplicate pipelines
+# https://docs.gitlab.com/ee/ci/yaml/index.html#switch-between-branch-pipelines-and-merge-request-pipelines
+workflow:
+ rules:
+ - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
+ - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"
+ when: never
+ - if: '$CI_COMMIT_TAG'
+ - if: '$CI_COMMIT_BRANCH'
# C coding style checker.
#
# Disabled for now, since we need to decide to reindent all the code first.
#
# style-check-diff:
-# extends: .only-default
# image: fedora:latest
# stage: style-check
# script:
@@ -47,7 +48,6 @@ stages:
opensuse-x86_64:
stage: build
extends:
- - '.only-default'
- '.container.opensuse@x86_64'
- '.fdo.distribution-image@opensuse'
needs: ['opensuse-container@x86_64']
@@ -72,7 +72,6 @@ opensuse-x86_64:
fedora-x86_64:
stage: build
extends:
- - '.only-default'
- '.container.fedora@x86_64'
- '.fdo.distribution-image@fedora'
needs: ['fedora-container@x86_64']
@@ -97,7 +96,6 @@ fedora-x86_64:
static-scan:
stage: analysis
extends:
- - '.only-default'
- '.container.opensuse@x86_64'
- '.fdo.distribution-image@opensuse'
needs: ['opensuse-container@x86_64']
@@ -116,7 +114,6 @@ static-scan:
asan-build:
stage: analysis
extends:
- - '.only-default'
- '.container.opensuse@x86_64'
- '.fdo.distribution-image@opensuse'
needs: ['opensuse-container@x86_64']
@@ -141,7 +138,6 @@ coverage:
stage: analysis
needs: []
extends:
- - '.only-default'
- '.container.opensuse@x86_64'
- '.fdo.distribution-image@opensuse'
needs: ['opensuse-container@x86_64']
@@ -171,7 +167,6 @@ coverage:
reference:
stage: docs
extends:
- - '.only-default'
- '.container.opensuse@x86_64'
- '.fdo.distribution-image@opensuse'
needs: ['opensuse-container@x86_64']
@@ -196,5 +191,7 @@ pages:
artifacts:
paths:
- public
- only:
- - master
+ rules:
+ - if: ($CI_DEFAULT_BRANCH == $CI_COMMIT_BRANCH)
+ # Restrict it to the gnome namespace to avoid every fork pushing a set of pages by default
+ # - if: ($CI_DEFAULT_BRANCH == $CI_COMMIT_BRANCH && $CI_PROJECT_NAMESPACE == "gnome") \ No newline at end of file