mirror of
https://github.com/aljazceru/lspd.git
synced 2026-01-28 10:24:20 +01:00
automation
This commit is contained in:
36
.github/actions/process-test-state/action.yaml
vendored
Normal file
36
.github/actions/process-test-state/action.yaml
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
name: "Process Test State"
|
||||
description: "Check, tar and upload test state"
|
||||
inputs:
|
||||
artifact-name:
|
||||
description: "Name of the artifact"
|
||||
required: true
|
||||
default: "test_state_artifact"
|
||||
test-state-path:
|
||||
description: "Path of the test state directory"
|
||||
required: true
|
||||
default: "/home/runner/test_state"
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Check if test_state directory exists
|
||||
id: check-test-state
|
||||
run: |
|
||||
if [ -d "${{ inputs.test-state-path }}" ]; then
|
||||
echo "exists=true" >> $GITHUB_ENV
|
||||
else
|
||||
echo "exists=false" >> $GITHUB_ENV
|
||||
fi
|
||||
shell: bash
|
||||
|
||||
- name: Tar state
|
||||
run: |
|
||||
find ${{ inputs.test-state-path }} -type f -o -type d | tar -czf ${{ inputs.test-state-path }}.tar.gz -T -
|
||||
shell: bash
|
||||
if: env.exists == 'true'
|
||||
|
||||
- name: Upload test_state as artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ inputs.artifact-name }}
|
||||
path: ${{ inputs.test-state-path }}.tar.gz
|
||||
if: env.exists == 'true'
|
||||
Reference in New Issue
Block a user