@@ -73,70 +73,64 @@ jobs:
73
73
restore-keys : |
74
74
${{ runner.os }}-gradle-
75
75
76
- - name : Download Build Artifacts
77
- uses : actions/download-artifact@v2
78
- with :
79
- name : app-build
80
- path : app/build/outputs/apk/
81
-
82
76
- name : Run Unit Tests and Capture Results
83
77
id : run_tests
84
78
run : |
85
79
./gradlew test | tee test-results.txt
86
80
TEST_RESULTS=$(grep -A 7 "Test Summary" test-results.txt | tail -n +2 | sed 's/\x1B\[[0-9;]*[JKmsu]//g' | tr -d '[:space:]')
87
81
echo "$TEST_RESULTS" > test-summary.txt
88
82
89
- - name : Format Test Results for Two-Row Markdown Table with Emojis
90
- run : |
91
- echo "### Test Results" > formatted-summary.txt
92
- echo "" >> formatted-summary.txt
93
- echo "| Total Tests | Passed | Failed | Skipped | Result |" >> formatted-summary.txt
94
- echo "|-------------|--------|--------|---------|--------|" >> formatted-summary.txt
83
+ # - name: Format Test Results for Two-Row Markdown Table with Emojis
84
+ # run: |
85
+ # echo "### Test Results" > formatted-summary.txt
86
+ # echo "" >> formatted-summary.txt
87
+ # echo "| Total Tests | Passed | Failed | Skipped | Result |" >> formatted-summary.txt
88
+ # echo "|-------------|--------|--------|---------|--------|" >> formatted-summary.txt
95
89
96
- echo "Raw Test Summary Content:"
97
- cat test-summary.txt
90
+ # echo "Raw Test Summary Content:"
91
+ # cat test-summary.txt
98
92
99
- # Extracting values using awk
100
- TOTAL=$(echo "$TEST_RESULTS" | awk -F'[ : ]+' '/TotalTests/ {print $2}')
101
- PASSED=$(echo "$TEST_RESULTS" | awk -F'[ : ]+' '/Passed/ {print $2}')
102
- FAILED=$(echo "$TEST_RESULTS" | awk -F'[ : ]+' '/Failed/ {print $2}')
103
- SKIPPED=$(echo "$TEST_RESULTS" | awk -F'[ : ]+' '/Skipped/ {print $2}')
104
- RESULT=$(echo "$TEST_RESULTS" | awk -F'[ : ]+' '/Result/ {print $2}')
93
+ # # Extracting values using awk
94
+ # TOTAL=$(echo "$TEST_RESULTS" | awk -F'[: ]+' '/TotalTests/ {print $2}')
95
+ # PASSED=$(echo "$TEST_RESULTS" | awk -F'[: ]+' '/Passed/ {print $2}')
96
+ # FAILED=$(echo "$TEST_RESULTS" | awk -F'[: ]+' '/Failed/ {print $2}')
97
+ # SKIPPED=$(echo "$TEST_RESULTS" | awk -F'[: ]+' '/Skipped/ {print $2}')
98
+ # RESULT=$(echo "$TEST_RESULTS" | awk -F'[: ]+' '/Result/ {print $2}')
105
99
106
- # Detailed debugging
107
- echo "Debug : Extracted Values:"
108
- echo " TOTAL : ' $TOTAL' "
109
- echo " PASSED: '$PASSED'"
110
- echo " FAILED : ' $FAILED' "
111
- echo " SKIPPED: '$SKIPPED'"
112
- echo " RESULT (Raw) : ' $RESULT' "
100
+ # # Detailed debugging
101
+ # echo "Debug: Extracted Values:"
102
+ # echo " TOTAL: '$TOTAL'"
103
+ # echo " PASSED: '$PASSED'"
104
+ # echo " FAILED: '$FAILED'"
105
+ # echo " SKIPPED: '$SKIPPED'"
106
+ # echo " RESULT (Raw): '$RESULT'"
113
107
114
- if [[ " $RESULT" == "SUCCESS" ]]; then
115
- EMOJI="✅"
116
- elif [[ "$RESULT" == "FAILURE" ]]; then
117
- EMOJI="❌"
118
- else
119
- EMOJI="⚠️"
120
- fi
108
+ # if [[ "$RESULT" == "SUCCESS" ]]; then
109
+ # EMOJI="✅"
110
+ # elif [[ "$RESULT" == "FAILURE" ]]; then
111
+ # EMOJI="❌"
112
+ # else
113
+ # EMOJI="⚠️"
114
+ # fi
121
115
122
- echo "Debug : Final RESULT after processing: '$RESULT $EMOJI'"
116
+ # echo "Debug: Final RESULT after processing: '$RESULT $EMOJI'"
123
117
124
- echo "| $TOTAL | $PASSED | $FAILED | $SKIPPED | $RESULT $EMOJI |" >> formatted-summary.txt
118
+ # echo "| $TOTAL | $PASSED | $FAILED | $SKIPPED | $RESULT $EMOJI |" >> formatted-summary.txt
125
119
126
- # Show the final output for debugging
127
- echo "Final formatted-summary.txt content:"
128
- cat formatted-summary.txt
120
+ # # Show the final output for debugging
121
+ # echo "Final formatted-summary.txt content:"
122
+ # cat formatted-summary.txt
129
123
130
- - name : Comment on PR
131
- if : github.event_name == 'pull_request'
132
- uses : actions/github-script@v6
133
- with :
134
- script : |
135
- const fs = require('fs');
136
- const testResults = fs.readFileSync('formatted-summary.txt', 'utf8');
137
- github.rest.issues.createComment({
138
- issue_number: context.issue.number,
139
- owner: context.repo.owner,
140
- repo: context.repo.repo,
141
- body: testResults
142
- });
124
+ # - name: Comment on PR
125
+ # if: github.event_name == 'pull_request'
126
+ # uses: actions/github-script@v6
127
+ # with:
128
+ # script: |
129
+ # const fs = require('fs');
130
+ # const testResults = fs.readFileSync('formatted-summary.txt', 'utf8');
131
+ # github.rest.issues.createComment({
132
+ # issue_number: context.issue.number,
133
+ # owner: context.repo.owner,
134
+ # repo: context.repo.repo,
135
+ # body: testResults
136
+ # });
0 commit comments