Skip to content

Commit 81455ac

Browse files
condition upload to lavapipe
1 parent 7676b1f commit 81455ac

1 file changed

Lines changed: 24 additions & 20 deletions

File tree

azure-pipelines.yml

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,29 @@ resources:
2020
- repo: self
2121

2222
stages:
23+
24+
- stage: OffloadGate
25+
dependsOn: []
26+
jobs:
27+
- job: gate
28+
pool:
29+
vmImage: ubuntu-latest
30+
steps:
31+
- checkout: none
32+
- bash: |
33+
run=true
34+
if [ "$(Build.Reason)" = "PullRequest" ]; then
35+
run=false
36+
labels=$(curl -sf "https://api.github.com/repos/$(Build.Repository.Name)/issues/$(System.PullRequest.PullRequestNumber)/labels" | python3 -c "import sys, json; print(' '.join(l['name'] for l in json.load(sys.stdin)))")
37+
for l in $labels; do [ "$l" = "run-offload-tests" ] && run=true; done
38+
fi
39+
echo "Build.Reason=$(Build.Reason) run=$run"
40+
echo "##vso[task.setvariable variable=run;isOutput=true]$run"
41+
name: decide
42+
2343
- stage: Build
44+
dependsOn:
45+
- OffloadGate
2446
jobs:
2547
- job: Windows
2648
timeoutInMinutes: 180
@@ -32,6 +54,7 @@ stages:
3254
HLSL_SRC_DIR: '$(Build.SourcesDirectory)'
3355
HLSL_BLD_DIR: '$(Agent.BuildDirectory)'
3456
platform: x64
57+
uploadArtifact: $[ stageDependencies.OffloadGate.gate.outputs['decide.run'] ]
3558

3659
strategy:
3760
matrix:
@@ -105,7 +128,7 @@ stages:
105128
condition: and(succeeded(), ne(variables['artifactName'], ''))
106129
- task: PublishPipelineArtifact@1
107130
displayName: 'Publish DXC binaries'
108-
condition: and(succeeded(), ne(variables['artifactName'], ''))
131+
condition: and(succeeded(), ne(variables['artifactName'], ''), eq(variables['uploadArtifact'], 'true'))
109132
inputs:
110133
targetPath: '$(Build.ArtifactStagingDirectory)\dxc'
111134
artifact: '$(artifactName)'
@@ -211,25 +234,6 @@ stages:
211234
testResultsFiles: '**/testresults.xunit.xml'
212235
condition: succeededOrFailed()
213236

214-
- stage: OffloadGate
215-
dependsOn: []
216-
jobs:
217-
- job: gate
218-
pool:
219-
vmImage: ubuntu-latest
220-
steps:
221-
- checkout: none
222-
- bash: |
223-
run=true
224-
if [ "$(Build.Reason)" = "PullRequest" ]; then
225-
run=false
226-
labels=$(curl -sf "https://api.github.com/repos/$(Build.Repository.Name)/issues/$(System.PullRequest.PullRequestNumber)/labels" | python3 -c "import sys, json; print(' '.join(l['name'] for l in json.load(sys.stdin)))")
227-
for l in $labels; do [ "$l" = "run-offload-tests" ] && run=true; done
228-
fi
229-
echo "Build.Reason=$(Build.Reason) run=$run"
230-
echo "##vso[task.setvariable variable=run;isOutput=true]$run"
231-
name: decide
232-
233237
- stage: OffloadTests
234238
displayName: 'Offload tests'
235239
dependsOn:

0 commit comments

Comments
 (0)