Skip to content

Commit 094e969

Browse files
committed
Merge branch 'ci/merge-request-pipeline' into 'main'
Add merge request pipeline to CI See merge request Sharpmake/sharpmake!606
2 parents 6cc0f62 + bc35068 commit 094e969

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

.gitlab/.gitlab-ci.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1-
# Pipelines runs only on branches and tags.
2-
# Disable merge request pipelines, pipelines for merge results and merge trains.
31
include:
4-
- template: 'Workflows/Branch-Pipelines.gitlab-ci.yml'
52
- project: 'Sharpmake/SharpmakeExtended'
63
file: 'build/sharpmake-ci.yml'
74

5+
workflow:
6+
rules:
7+
# Enable merge request pipelines.
8+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
9+
# Avoid duplicate pipelines when pushing in a branch.
10+
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
11+
when: never
12+
# Else run pipelines for branches and tags.
13+
- if: $CI_COMMIT_BRANCH
14+
- if: $CI_COMMIT_TAG
15+
816
stages:
917
- build
1018
- test

.gitlab/Get-SamplesPipeline.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ foreach ($sample in $samplesDef.Samples)
9393

9494
# Merge sample properties into a single hash table.
9595
$sampleJob = $osProperties + @{
96+
rules = @(
97+
@{ if = '$CI_PIPELINE_SOURCE == "parent_pipeline"' }
98+
)
9699
artifacts = [PSCustomObject]@{
97100
when = 'on_failure'
98101
untracked = $true

0 commit comments

Comments
 (0)