From eaa3a8d45413208312d482ec8a64a8b3c3c6bcc5 Mon Sep 17 00:00:00 2001 From: Eric Ball Date: Thu, 18 Jan 2024 14:45:38 -0800 Subject: [PATCH] CI: Add pre-build script option to action and wf Testing shows that hashFiles will evaluate to false if the file name is empty or blank, so this effectively checks both whether or not the file path was provided, and that the file actually exists within the repo. Signed-off-by: Eric Ball --- .github/actions/tox-run-action/action.yaml | 8 ++++++++ .github/workflows/gerrit-compose-required-tox-verify.yaml | 6 +++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/actions/tox-run-action/action.yaml b/.github/actions/tox-run-action/action.yaml index 612c109..916a31d 100644 --- a/.github/actions/tox-run-action/action.yaml +++ b/.github/actions/tox-run-action/action.yaml @@ -18,6 +18,10 @@ inputs: description: "Whether to run jobs in parallel" required: false default: "auto" + pre-build-script: + description: "Optional pre-build script to trigger before verify run" + required: false + default: "" runs: using: "composite" @@ -27,6 +31,10 @@ runs: with: python-version: ${{ inputs.py-version }} cache: pip + - name: Run pre-build-script + id: pre-build + if: ${{ hashFiles(inputs.pre-build-script) }} + run: ${{ inputs.pre-build-script }} - name: Build package (if available) id: build-package if: ${{ hashFiles('pyproject.toml') != '' }} diff --git a/.github/workflows/gerrit-compose-required-tox-verify.yaml b/.github/workflows/gerrit-compose-required-tox-verify.yaml index 1d15d08..15801b3 100644 --- a/.github/workflows/gerrit-compose-required-tox-verify.yaml +++ b/.github/workflows/gerrit-compose-required-tox-verify.yaml @@ -39,7 +39,11 @@ on: PARALLEL: description: "Whether to run jobs in parallel" required: false - default: "true" + type: string + PRE_BUILD_SCRIPT: + description: "Optional pre-build script to trigger before verify run" + required: false + default: "" type: string concurrency: