Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add action.yml and self-test #1

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: "CI Full Run"
on:
pull_request:
branches:
- main
- grok/*/*
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Create dummy file
run: echo "dummy" > dummy.txt
- name: Test store
uses: ./
with:
action: "store"
storage-host: ""
- name: Remove dummy file
run: rm dummy.txt
- name: Test load
uses: ./
with:
action: "load"
storage-host: ""
- name: Check that dummy file was restored
run: |
ls -la ~/ci-storage
[ "$(cat dummy.txt)" = "dummy" ] || { echo "dummy.txt was not restored"; exit 1; }
43 changes: 43 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
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."
required: true
storage-dir:
description: "Storage directory on the remote host. If not set, 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 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: >
pwd && ./ci-storage
--storage-host="${{ inputs.storage-host || '' }}"
--storage-dir="${{ inputs.storage-dir || '' }}"
--storage-max-age-sec="${{ inputs.storage-max-age-sec || '' }}"
--slot-id="${{ inputs.slot-id || format('{0}-{1}', github.run_id, github.run_attempt) }}"
--local-dir="${{ inputs.local-dir || '.' }}"
--exclude="${{ inputs.exclude || '' }}"
${{ inputs.verbose && '--verbose' || '' }}
${{ inputs.action }}
shell: bash
Loading