mirror of
https://github.com/storytold/craft-common-actions.git
synced 2026-11-15 15:02:24 +00:00
feat(gate): support caller setup commands (#224)
This commit is contained in:
1 parent
804f702057
commit
fd88e26a87
3 files changed
+49
No files matched your search
@@ -17,6 +17,11 @@ on:
|
||||
type: string
|
||||
required: false
|
||||
default: "cargo xtask ci"
|
||||
setup-command:
|
||||
description: "Optional setup script, run from the repository root before the gate (for example, fetch SHA-verified corpora)"
|
||||
type: string
|
||||
required: false
|
||||
default: ""
|
||||
windows-command:
|
||||
description: "The gate on Windows legs; empty runs `command`"
|
||||
type: string
|
||||
@@ -274,6 +279,16 @@ jobs:
|
||||
save-if: ${{ github.event_name != 'pull_request' && (github.ref_name == github.event.repository.default_branch || (inputs.cache-save-on-dispatch && github.event_name == 'workflow_dispatch')) }}
|
||||
cache-on-failure: true
|
||||
|
||||
- name: Caller setup
|
||||
if: inputs.setup-command != ''
|
||||
shell: bash
|
||||
env:
|
||||
SETUP: ${{ inputs.setup-command }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
printf '%s\n' "$SETUP" > "$RUNNER_TEMP/gate-setup.sh"
|
||||
bash -euo pipefail "$RUNNER_TEMP/gate-setup.sh"
|
||||
|
||||
- name: Gate
|
||||
shell: bash
|
||||
env:
|
||||
|
||||
Reference in new issue
Block a user