From abf4df578bd151f3f3d2d7e682041f9e3c6121fd Mon Sep 17 00:00:00 2001 From: Jisu Kim <108998071+jisu15-kim@users.noreply.github.com> Date: Sun, 15 Sep 2024 20:38:32 +0900 Subject: [PATCH] [Infra] Github Action Report --- .github/workflows/unitTest.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unitTest.yml b/.github/workflows/unitTest.yml index 78149ca..1b1de7d 100644 --- a/.github/workflows/unitTest.yml +++ b/.github/workflows/unitTest.yml @@ -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: |