From 422dd88166a382d6311b8adcc828e5b044f28e65 Mon Sep 17 00:00:00 2001 From: Michael Kubacki Date: Tue, 24 Sep 2024 19:30:59 -0400 Subject: [PATCH] PrGate.yml: Add extra_pre_build_steps param (#378) 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 --- Jobs/PrGate.yml | 5 +++++ Steps/PrGate.yml | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/Jobs/PrGate.yml b/Jobs/PrGate.yml index d6789224..35c2e4e5 100644 --- a/Jobs/PrGate.yml +++ b/Jobs/PrGate.yml @@ -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 @@ -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) }}: diff --git a/Steps/PrGate.yml b/Steps/PrGate.yml index 387c6e2b..0e2b24e3 100644 --- a/Steps/PrGate.yml +++ b/Steps/PrGate.yml @@ -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 @@ -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