Skip to content

Commit 8b32344

Browse files
committed
use python script to download compiler cache
this way we can ensure that cache from partially succeeded jobs are available
1 parent 406efe8 commit 8b32344

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

.ci/download-extract.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,15 @@ steps:
2121
downloadPath: ${{ parameters.downloadPath }}
2222

2323
- ${{ if and(ne(parameters.specificBuildWithTriggering, 'true'), ne(variables['Build.Reason'], 'PullRequest')) }}:
24-
- task: DownloadBuildArtifacts@0
24+
- task: PythonScript@0
2525
displayName: ${{ format('Download {0} archive', parameters.name) }}
2626
continueOnError: true
2727
inputs:
28-
buildType: 'specific'
29-
project: $(System.TeamProjectId)
30-
pipeline: $(System.DefinitionId)
31-
buildVersionToDownload: "latest"
32-
allowPartiallySucceededBuilds: true
33-
artifactName: ${{ parameters.artifactName }}
34-
downloadPath: ${{ parameters.downloadPath }}
28+
scriptSource: 'filePath'
29+
scriptPath: '.ci/get_latest_artifact.py'
30+
arguments: '$(Build.SourceBranchName) ${{ parameters.artifactName }}'
31+
workingDirectory: ${{ parameters.downloadPath }}
32+
failOnStderr: true
3533

3634
# TODO: change back to DownloadBuildArtifacts task when this issue is fixed
3735
# https://github.com/MicrosoftDocs/vsts-docs/issues/2889

.ci/get_latest_artifact.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
target_branch = sys.argv[1]
1313
artifact_name = sys.argv[2]
14-
url = 'https://dev.azure.com/shogunml/shogun/_apis/build/builds?api-version=4.1&resultFilter=succeeded&branchName=refs/heads/%s' % (target_branch)
14+
url = 'https://dev.azure.com/shogunml/shogun/_apis/build/builds?api-version=4.1&resultFilter=partiallySucceeded,succeeded&branchName=refs/heads/%s' % (target_branch)
1515
response = urllib.urlopen(url)
1616
content = json.loads(response.read())
1717
if content['count'] > 0:

0 commit comments

Comments
 (0)