-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Test and Build workflow (#648)
- Prevent unintended labels from triggering test workflow - Prevent pull request from triggering build workflows since test workflow would build EDM4U. - Prevent test workflow from emitting error message just because `grep` command did not get any failed tests.
- Loading branch information
Showing
2 changed files
with
33 additions
and
7 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
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 |
---|---|---|
|
@@ -66,8 +66,36 @@ jobs: | |
echo "include_test_modules=" >> $GITHUB_OUTPUT | ||
echo "exclude_test_modules=" >> $GITHUB_OUTPUT | ||
echo "exclude_tests=" >> $GITHUB_OUTPUT | ||
# This is currently checking for invalid trigger only. | ||
if [[ "${{ github.event_name }}" == "schedule" ]]; then | ||
# Do nothing for now | ||
: | ||
elif [[ "${{ github.event_name }}" == "pull_request" ]]; then | ||
if [[ "${{ github.event.action }}" == "labeled" && "${{ github.event.label.name }}" == "tests-requested" ]]; then | ||
# Do nothing for now | ||
: | ||
elif [[ "${{ github.event.action }}" == "closed" && "${{ github.event.pull_request.merged == true}}" == "true" ]]; then | ||
# Do nothing for now | ||
: | ||
else | ||
echo "invalid_trigger=1" >> $GITHUB_OUTPUT | ||
fi | ||
else | ||
echo "invalid_trigger=1" >> $GITHUB_OUTPUT | ||
fi | ||
fi | ||
- name: Cancel workflow | ||
if: ${{ steps.set_outputs.outputs.invalid_trigger }} | ||
uses: andymckay/[email protected] | ||
|
||
- name: Wait for workflow cancellation | ||
if: ${{ steps.set_outputs.outputs.invalid_trigger }} | ||
run: | | ||
sleep 300 | ||
exit 1 # fail out if the cancellation above somehow failed. | ||
- name: Print output | ||
run: | | ||
echo outputs.unity_version : ${{ steps.set_outputs.outputs.unity_version }} | ||
|
@@ -119,14 +147,15 @@ jobs: | |
continue-on-error: true | ||
run: cat test_output/test*IntegrationTestsBatchMode/*.log | ||
|
||
- name: Obtain Failed tests | ||
- name: Obtain Failed tests from Integration tests and NUnit tests | ||
if: always() | ||
shell: bash | ||
continue-on-error: true | ||
run: | | ||
cat test_output/test*/*_test.log | grep "^Test .* PASSED$" | ||
cat test_output/test*/*_test.log | grep "^Test .* FAILED$" | ||
cat test_output/test*/*_test.log | grep "^Test .* SKIPPED$" | ||
# Quick and dirty way to get all failed tests in granular level. | ||
# TODO: better parser for more information, ex. error message. | ||
{ cat test_output/test*/*_test.log || true; } | { grep "^Test .* FAILED$" || true; } | ||
{ cat test_output/test*/test*/results.xml || true; } | { grep '^ *<test-case.*result="Failed"' || true; } | sed 's/^.* name="\([^\"]*\)".*$/Test \1: FAILED/' | ||
- name: Return Unity license | ||
if: always() | ||
|