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
37 - name: usePythonVersion
43 echo "##vso[task.prependpath]${HOME}/.local/bin"
44 echo "new PATH=${PATH}"
46 condition: eq('${{ parameters.tool_chain_tag }}', 'GCC5')
52 - task: UsePythonVersion@0
54 versionSpec: ${{ parameters.usePythonVersion }}
56 condition: ne('${{ parameters.usePythonVersion }}', '')
58 - script: pip install -r pip-requirements.txt --upgrade
59 displayName: 'Install/Upgrade pip modules'
62 - bash: echo "##vso[task.setvariable variable=pkg_count]${{ 1 }}"
64 # Fetch the target branch so that pr_eval can diff them.
65 # Seems like azure pipelines/github changed checkout process in nov 2020.
66 - script: git fetch origin $(System.PullRequest.targetBranch)
67 displayName: fetch target branch
68 condition: eq(variables['Build.Reason'], 'PullRequest')
70 # trim the package list if this is a PR
72 displayName: Check if ${{ parameters.build_pkg }} need testing
74 filename: stuart_pr_eval
75 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}"
76 condition: eq(variables['Build.Reason'], 'PullRequest')
82 filename: stuart_setup
83 arguments: -c ${{ parameters.build_file }} TOOL_CHAIN_TAG=${{ parameters.tool_chain_tag}} -t ${{ parameters.build_target}} -a ${{ parameters.build_arch}} ${{ parameters.build_flags}}
84 condition: and(gt(variables.pkg_count, 0), succeeded())
90 filename: stuart_update
91 arguments: -c ${{ parameters.build_file }} TOOL_CHAIN_TAG=${{ parameters.tool_chain_tag}} -t ${{ parameters.build_target}} -a ${{ parameters.build_arch}} ${{ parameters.build_flags}}
92 condition: and(gt(variables.pkg_count, 0), succeeded())
95 # do this after setup and update so that code base dependencies
97 - template: basetools-build-steps.yml
99 tool_chain_tag: ${{ parameters.tool_chain_tag }}
101 # Potential Extra steps
102 - ${{ parameters.extra_install_step }}
108 filename: stuart_build
109 arguments: -c ${{ parameters.build_file }} TOOL_CHAIN_TAG=${{ parameters.tool_chain_tag}} TARGET=${{ parameters.build_target}} -a ${{ parameters.build_arch}} ${{ parameters.build_flags}}
110 condition: and(gt(variables.pkg_count, 0), succeeded())
114 displayName: Run to shell
116 filename: stuart_build
117 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
118 condition: and(and(gt(variables.pkg_count, 0), succeeded()), eq(variables['Run'], true))
121 # Copy the build logs to the artifact staging directory
123 displayName: "Copy build logs"
125 targetFolder: "$(Build.ArtifactStagingDirectory)"
126 SourceFolder: "Build"
137 **/BUILD_TOOLS_REPORT.html
141 condition: succeededOrFailed()
143 # Publish build artifacts to Azure Artifacts/TFS or a file share
144 - task: PublishBuildArtifacts@1
145 continueOnError: true
146 displayName: "Publish build logs"
148 pathtoPublish: "$(Build.ArtifactStagingDirectory)"
149 artifactName: "Build Logs $(System.JobName)"
150 condition: succeededOrFailed()