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

fix(action): always store outputs, even when test fails. #49

Merged
merged 1 commit into from
Apr 24, 2024
Merged
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
15 changes: 10 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ inputs:
outputs:
report:
description: "Generated report xml"
value: ${{ steps.run-tests.outputs.report }}
value: ${{ steps.store-outputs.outputs.report }}

runs:
using: "composite"
Expand Down Expand Up @@ -74,7 +74,6 @@ runs:
${{ inputs.sudo }} apt install -y --no-install-recommends build-essential clang make llvm gcc dkms

- name: Run tests
id: run-tests
working-directory: ${{ github.action_path }}
env:
# fixme(leogr): this is a workaround for https://github.com/falcosecurity/falco/issues/2784
Expand All @@ -96,18 +95,24 @@ runs:
fi
fi
cat ./report.txt | go-junit-report -set-exit-code > report.xml
echo "report=$(realpath report.xml)" >> $GITHUB_OUTPUT

- name: Set outputs
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reintroduce the store-outputs step and run it always.

id: store-outputs # note: store outputs even if tests fail
shell: bash
if: always()
run: |
echo "report=${{ github.action_path }}/report.xml" >> $GITHUB_OUTPUT

- name: Test Summary
if: always() # note: upload the report even if tests fail
uses: test-summary/action@62bc5c68de2a6a0d02039763b8c754569df99e3f
with:
paths: ${{ steps.run-tests.outputs.report }}
paths: ${{ steps.store-outputs.outputs.report }}
show: ${{ inputs.show-all && 'all' || 'fail' }}

- name: Upload Test Summary
if: always() # note: upload the report even if tests fail
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: falcosecurity-testing-report-${{ runner.arch }}
path: ${{ steps.run-tests.outputs.report }}
path: ${{ steps.store-outputs.outputs.report }}
Loading