ci: Only run by default when scheduled for merge request

VirGL just runs way too many jobs, with each pipeline consuming the
entire committed x86-64 build capacity we have available, so we need to
restrict it anyway. This is made worse by the fact it will create
duplicate pipelines for merge requests.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/744>
macos/master
Daniel Stone 3 years ago committed by Marge Bot
parent 8d7603a1f1
commit f3428dc71e
  1. 57
      .gitlab-ci.yml

@ -32,6 +32,38 @@ include:
file:
- '/.gitlab-ci/image-tags.yml'
# YAML anchors for rule conditions
# --------------------------------
.rules-anchors:
rules:
# Scheduled pipeline
- if: &is-scheduled-pipeline '$CI_PIPELINE_SOURCE == "schedule"'
when: on_success
# For Marge Bot
- if: &is-for-marge '$GITLAB_USER_LOGIN == "marge-bot"'
when: never
# Forked project branch
- if: &is-forked-branch '$CI_PROJECT_NAMESPACE != "virgl" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != $CI_COMMIT_REF_NAME'
when: manual
# Forked project branch / pre-merge pipeline not for Marge bot
- if: &is-forked-branch-or-pre-merge-not-for-marge '$CI_PROJECT_NAMESPACE != "virgl" || ($GITLAB_USER_LOGIN != "marge-bot" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == $CI_COMMIT_REF_NAME)'
when: manual
# Pipeline runs for the main branch of the upstream virglrenderer project
- if: &is-virglrenderer-main '$CI_PROJECT_NAMESPACE == "virgl" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != $CI_DEFAULT_BRANCH'
when: always
# Post-merge pipeline
- if: &is-post-merge '$CI_PROJECT_NAMESPACE == "virgl" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != $CI_COMMIT_REF_NAME'
when: on_success
# Post-merge pipeline, not for Marge Bot
- if: &is-post-merge-not-for-marge '$CI_PROJECT_NAMESPACE == "virgl" && $GITLAB_USER_LOGIN != "marge-bot" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != $CI_COMMIT_REF_NAME'
when: on_success
# Pre-merge pipeline
- if: &is-pre-merge '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == $CI_COMMIT_REF_NAME'
when: on_success
# Pre-merge pipeline for Marge Bot
- if: &is-pre-merge-for-marge '$GITLAB_USER_LOGIN == "marge-bot" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == $CI_COMMIT_REF_NAME'
when: on_success
stages:
- build
- sanity test
@ -64,11 +96,16 @@ debian/x86_build:
paths:
- install/
- results/
only:
- branches
- tags
- merge_requests
- schedules
rules:
- if: *is-scheduled-pipeline
when: on_success
- if: *is-post-merge
when: never
- if: *is-forked-branch-or-pre-merge-not-for-marge
when: manual
- if: *is-pre-merge-for-marge
when: on_success
- when: manual
#
# Sanity test jobs
@ -77,6 +114,7 @@ debian/x86_build:
.make_check_base:
stage: sanity test
extends: debian/x86_build
dependencies: []
artifacts:
when: always
paths:
@ -126,13 +164,10 @@ make check venus:
- results/
reports:
junit: results/junit.xml
needs:
dependencies:
- debian/x86_build
only:
- branches
- tags
- merge_requests
- schedules
rules:
- when: on_success
.gl-host-test:
extends:

Loading…
Cancel
Save