-
Notifications
You must be signed in to change notification settings - Fork 555
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
10045: Extract reusable action for test artifact upload r=menski a=menski ## Description Create composite github action to bundle test artifact upload steps. At the moment the steps are: - clean system-out from test XML output - upload test artifact for later use ## Related issues <!-- Which issues are closed by this PR or are related --> closes #9135 Co-authored-by: Sebastian Menski <sebastian.menski@camunda.com>
- Loading branch information
Showing
3 changed files
with
62 additions
and
64 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,41 @@ | ||
--- | ||
name: Collect test artifacts | ||
|
||
description: Collects test outputs and uploads them as artifact | ||
|
||
inputs: | ||
name: | ||
description: 'Name of the test artifact.' | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
|
||
# MacOS sed is not compatible with the remove script, we need gnu sed instead | ||
- name: Install GNU sed | ||
if: runner.os == 'macOS' | ||
shell: bash | ||
run: | | ||
brew install gnu-sed | ||
echo "SED_BIN=gsed" >> $GITHUB_ENV | ||
# Mitigate to large test output files by deleting the system-out element using sed | ||
# Note: we cannot use XML tools like xmlstarlet as they all suffer the same libxml2 limitation | ||
# Related to https://github.com/camunda/zeebe/issues/9959 | ||
- name: Remove system-out from test xml files | ||
shell: bash | ||
run: | | ||
find . -iname TEST-*.xml -print0 | xargs -0 -r ${SED_BIN:-sed} '/<system-out>/,/<\/system-out>/d' -i | ||
- name: Archive Test Results | ||
uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: Test results for ${{ inputs.name }} | ||
path: | | ||
**/target/failsafe-reports/ | ||
**/target/surefire-reports/ | ||
**/hs_err_*.log | ||
retention-days: 7 | ||
if-no-files-found: ignore |
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