5 # template file containing the steps to build
7 # Copyright (c) Microsoft Corporation.
8 # SPDX-License-Identifier: BSD-2-Clause-Patent
12 - name: tool_chain_tag
34 - name: extra_install_step
43 - task: UsePythonVersion@0
48 - script: pip install -r pip-requirements.txt --upgrade
49 displayName: 'Install/Upgrade pip modules'
52 - bash: echo "##vso[task.setvariable variable=pkg_count]${{ 1 }}"
54 # Fetch the target branch so that pr_eval can diff them.
55 # Seems like azure pipelines/github changed checkout process in nov 2020.
56 - script: git fetch origin $(System.PullRequest.targetBranch)
57 displayName: fetch target branch
58 condition: eq(variables['Build.Reason'], 'PullRequest')
60 # trim the package list if this is a PR
62 displayName: Check if ${{ parameters.build_pkg }} need testing
64 filename: stuart_pr_eval
65 arguments: -c ${{ parameters.build_file }} -t ${{ parameters.build_target}} -a ${{ parameters.build_arch}} --pr-target origin/$(System.PullRequest.targetBranch) --output-count-format-string "##vso[task.setvariable variable=pkg_count;isOutpout=true]{pkgcount}"
66 condition: eq(variables['Build.Reason'], 'PullRequest')
72 filename: stuart_setup
73 arguments: -c ${{ parameters.build_file }} TOOL_CHAIN_TAG=${{ parameters.tool_chain_tag}} -t ${{ parameters.build_target}} -a ${{ parameters.build_arch}} ${{ parameters.build_flags}}
74 condition: and(gt(variables.pkg_count, 0), succeeded())
80 filename: stuart_update
81 arguments: -c ${{ parameters.build_file }} TOOL_CHAIN_TAG=${{ parameters.tool_chain_tag}} -t ${{ parameters.build_target}} -a ${{ parameters.build_arch}} ${{ parameters.build_flags}}
82 condition: and(gt(variables.pkg_count, 0), succeeded())
85 # do this after setup and update so that code base dependencies
87 - template: basetools-build-steps.yml
89 tool_chain_tag: ${{ parameters.tool_chain_tag }}
91 # Potential Extra steps
92 - ${{ parameters.extra_install_step }}
98 filename: stuart_build
99 arguments: -c ${{ parameters.build_file }} TOOL_CHAIN_TAG=${{ parameters.tool_chain_tag}} TARGET=${{ parameters.build_target}} -a ${{ parameters.build_arch}} ${{ parameters.build_flags}}
100 condition: and(gt(variables.pkg_count, 0), succeeded())
104 displayName: Run to shell
106 filename: stuart_build
107 arguments: -c ${{ parameters.build_file }} TOOL_CHAIN_TAG=${{ parameters.tool_chain_tag}} TARGET=${{ parameters.build_target}} -a ${{ parameters.build_arch}} ${{ parameters.build_flags}} ${{ parameters.run_flags }} --FlashOnly
108 condition: and(and(gt(variables.pkg_count, 0), succeeded()), eq(variables['Run'], true))
111 # Copy the build logs to the artifact staging directory
113 displayName: "Copy build logs"
115 targetFolder: "$(Build.ArtifactStagingDirectory)"
116 SourceFolder: "Build"
127 **/BUILD_TOOLS_REPORT.html
131 condition: succeededOrFailed()
133 # Publish build artifacts to Azure Artifacts/TFS or a file share
134 - task: PublishBuildArtifacts@1
135 continueOnError: true
136 displayName: "Publish build logs"
138 pathtoPublish: "$(Build.ArtifactStagingDirectory)"
139 artifactName: "Build Logs $(System.JobName)"
140 condition: succeededOrFailed()