-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
515 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: "CI Storage" | ||
description: "Quickly stores the content of huge work directory with low percentage of changed files in the storage on a remote host, or loads the content from the storage." | ||
inputs: | ||
action: | ||
description: "What to do (store or load)." | ||
required: true | ||
storage-host: | ||
description: "Storage host in the format [user@]host; it must have password-free SSH key access. If not set, uses CI_STORAGE_HOST environment variable. Must not be empty eventually." | ||
required: false | ||
storage-dir: | ||
description: "Storage directory on the remote host. If not set, uses CI_STORAGE_DIR environment variable. If still empty, uses the ci-storage tool default ~/ci-storage." | ||
required: false | ||
storage-max-age-sec: | ||
description: "Remove slots created earlier than this many seconds ago. If not set, uses CI_STORAGE_MAX_AGE_SEC environment variable. If still empty, uses the ci-storage tool default 4 hours." | ||
required: false | ||
slot-id: | ||
description: 'Id of the slot to store to or load from; use "*" to load a random most recent slot. If empty, uses "$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT" value.' | ||
required: false | ||
local-dir: | ||
description: 'Local directory path to store from or load to. If not set, uses "." (the current work directory).' | ||
required: false | ||
exclude: | ||
description: "Newline separated exclude pattern(s) for rsync." | ||
required: false | ||
verbose: | ||
description: "If set, prints the list of transferred files." | ||
type: boolean | ||
required: false | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Run ci-storage ${{ inputs.action }} | ||
run: ci-storage \ | ||
--storage-host="$CI_STORAGE_HOST" \ | ||
--storage-dir="$CI_STORAGE_DIR" \ | ||
--storage-max-age-sec="$CI_STORAGE_MAX_AGE_SEC" \ | ||
--slot-id="$SLOT_ID" \ | ||
--local-dir="$LOCAL_DIR" \ | ||
--exclude="$EXCLUDE" \ | ||
$VERBOSE \ | ||
"${{ inputs.action }}" | ||
shell: bash | ||
env: | ||
CI_STORAGE_HOST: ${{ inputs.storage-host || env.CI_STORAGE_HOST || "" }} | ||
CI_STORAGE_DIR: ${{ inputs.storage-dir || env.CI_STORAGE_DIR || "" }} | ||
CI_STORAGE_MAX_AGE_SEC: ${{ inputs.storage-max-age-sec || env.CI_STORAGE_MAX_AGE_SEC || "" }} | ||
SLOT_ID: ${{ inputs.slot-id || format("{0}-{1}", env.GITHUB_RUN_ID, env.GITHUB_RUN_ATTEMPT) }} | ||
LOCAL_DIR: ${{ inputs.local-dir || "." }} | ||
EXCLUDE: ${{ inputs.exclude || "" }} | ||
VERBOSE: ${{ inputs.verbose && "--verbose" || "" }} |
Oops, something went wrong.