Skip to content

Commit

Permalink
CI: Add pre-build script option to action and wf
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
eb-oss committed Jan 18, 2024
1 parent 13b62ea commit eaa3a8d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .github/actions/tox-run-action/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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') != '' }}
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/gerrit-compose-required-tox-verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit eaa3a8d

Please sign in to comment.