forked from lima-vm/lima
-
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.
test.yml: upload
failed-logs
as an artifact if test-templates.sh
…
…fails and `failed-logs` exists. silence yamllint test:yml: switch to `if: always()`, if the previous step uses `retry` test.yml: change to `failure-logs` upload_failure_logs_if_exists: fix error: required property is missing: shell upload_failure_logs_if_exists: ensure the artifact name is unique. upload_failure_logs_if_exists: normalize suffix input upload_failure_logs_if_exists: add description comment to normalize-suffix Signed-off-by: Norio Nomura <[email protected]>
- Loading branch information
1 parent
3075bd9
commit 8741f67
Showing
3 changed files
with
45 additions
and
1 deletion.
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,30 @@ | ||
name: 'upload failure-logs if exists' | ||
description: 'upload failure-logs if exists' | ||
inputs: | ||
suffix: | ||
description: suffix to append to the name of the artifact | ||
required: false | ||
default: '' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: "Check if failure-logs exists" | ||
if: always() | ||
id: check-if-failure-logs-exists | ||
run: echo "exists=$([ -d "failure-logs" ] && echo "true" || echo "false")" >> "$GITHUB_OUTPUT" | ||
shell: bash | ||
- id: normalize-suffix | ||
# To avoid using special characters in artifact name, normalize the suffix | ||
if: steps.check-if-failure-logs-exists.outputs.exists == 'true' | ||
run: | | ||
suffix="${{ inputs.suffix }}" | ||
suffix="${suffix//[^a-zA-Z0-9_]/_}" | ||
suffix="${suffix:+-$suffix}" | ||
echo "result=$suffix" >> "$GITHUB_OUTPUT" | ||
shell: bash | ||
- name: "Upload failure-logs" | ||
if: steps.check-if-failure-logs-exists.outputs.exists == 'true' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: failure-logs-${{ github.job }}${{ steps.normalize-suffix.outputs.result }} | ||
path: failure-logs/ |
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
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