Skip to content

Commit

Permalink
[Infra] Github Action Report
Browse files Browse the repository at this point in the history
  • Loading branch information
jisu15-kim authored Sep 15, 2024
1 parent 3ad6709 commit abf4df5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/unitTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,33 @@ jobs:
run: |
curl https://mise.run | sh
mise install
- name: Install Tuist dependencies
run: mise x -- tuist install

- name: Generate Xcworkspace
run: mise x -- tuist generate

- name: Run unit tests
run: |
xcodebuild test -scheme three-days-UnitTest -destination 'platform=iOS Simulator,name=iPhone 15,OS=latest' | tee result.log
continue-on-error: true

- name: Parse test results
id: parse_test_results
run: |
TOTAL_TESTS=$(grep -oE 'Test Suite .* executed ([0-9]+) tests' result.log | grep -oE '[0-9]+' | head -n 1)
FAILED_TESTS=$(grep -oE 'Failing tests:.*' -A 20 result.log | grep -oE '[0-9]+' | head -n 1)
FAILED_TEST_NAMES=$(grep -oE '^[[:space:]]+[0-9]+\) (.*)' result.log | awk '{$1=""; print $0}')
echo "Total tests: $TOTAL_TESTS"
echo "Failed tests: $FAILED_TESTS"
echo "Failed test names: $FAILED_TEST_NAMES"

echo "TOTAL_TESTS=$TOTAL_TESTS" >> $GITHUB_ENV
echo "FAILED_TESTS=$FAILED_TESTS" >> $GITHUB_ENV
echo "FAILED_TEST_NAMES=$FAILED_TEST_NAMES" >> $GITHUB_ENV

- name: Notify Discord
if: ${{ always() }}
run: |
Expand Down

0 comments on commit abf4df5

Please sign in to comment.