Skip to content

Commit

Permalink
PrGate.yml: Add extra_pre_build_steps param (#378)
Browse files Browse the repository at this point in the history
Adds a new template parameter called `extra_pre_build_steps` that allows
a step list to run before any stuart build related commands are
executed.

Signed-off-by: Michael Kubacki <[email protected]>
  • Loading branch information
makubacki authored Sep 24, 2024
1 parent 9cc7a80 commit 422dd88
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Jobs/PrGate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ parameters:
displayName: Extra Build Command Arguments
type: string
default: 'CODE_COVERAGE=TRUE CC_FLATTEN=TRUE CC_FULL=TRUE'
- name: extra_pre_build_steps
displayName: Extra Pre-Build Steps
type: stepList
default: []
- name: extra_post_build_steps
displayName: Extra Post-Build Steps
type: stepList
Expand Down Expand Up @@ -166,6 +170,7 @@ jobs:
tool_chain_tag: ${{ parameters.tool_chain_tag }}
install_tools: ${{ and(not(eq(item.Value.SelfHostAgent, true)), not(parameters.container_build)) }}
extra_install_step: ${{ parameters.extra_install_step }}
extra_pre_build_steps: ${{ parameters.extra_pre_build_steps }}
extra_post_build_steps: ${{ parameters.extra_post_build_steps }}
# This is to handle the matrices that do not specify this.
${{ if eq(item.Value.SelfHostAgent, true) }}:
Expand Down
7 changes: 7 additions & 0 deletions Steps/PrGate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ parameters:
displayName: Extra Install Steps
type: stepList
default: []
- name: extra_pre_build_steps
displayName: Extra Pre-Build Steps
type: stepList
default: []
- name: extra_post_build_steps
displayName: Extra Post-Build Steps
type: stepList
Expand Down Expand Up @@ -140,6 +144,9 @@ steps:
- ${{ if eq(parameters.install_tools, true) }}:
- template: InstallCoverageTools.yml

# Potential pre-build steps
- ${{ parameters.extra_pre_build_steps }}

# Build repo
- ${{ if eq(parameters.do_ci_setup, true) }}:
- task: CmdLine@2
Expand Down

0 comments on commit 422dd88

Please sign in to comment.