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'