Skip to content

Commit 2c02563

Browse files
authored
Update ci.yml
1 parent ee047e8 commit 2c02563

File tree

1 file changed

+46
-52
lines changed

1 file changed

+46
-52
lines changed

.github/workflows/ci.yml

Lines changed: 46 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -73,70 +73,64 @@ jobs:
7373
restore-keys: |
7474
${{ runner.os }}-gradle-
7575
76-
- name: Download Build Artifacts
77-
uses: actions/download-artifact@v2
78-
with:
79-
name: app-build
80-
path: app/build/outputs/apk/
81-
8276
- name: Run Unit Tests and Capture Results
8377
id: run_tests
8478
run: |
8579
./gradlew test | tee test-results.txt
8680
TEST_RESULTS=$(grep -A 7 "Test Summary" test-results.txt | tail -n +2 | sed 's/\x1B\[[0-9;]*[JKmsu]//g' | tr -d '[:space:]')
8781
echo "$TEST_RESULTS" > test-summary.txt
8882
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
9589

96-
echo "Raw Test Summary Content:"
97-
cat test-summary.txt
90+
# echo "Raw Test Summary Content:"
91+
# cat test-summary.txt
9892

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}')
10599

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'"
113107

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
121115

122-
echo "Debug: Final RESULT after processing: '$RESULT $EMOJI'"
116+
# echo "Debug: Final RESULT after processing: '$RESULT $EMOJI'"
123117

124-
echo "| $TOTAL | $PASSED | $FAILED | $SKIPPED | $RESULT $EMOJI |" >> formatted-summary.txt
118+
# echo "| $TOTAL | $PASSED | $FAILED | $SKIPPED | $RESULT $EMOJI |" >> formatted-summary.txt
125119

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
129123

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

Comments
 (0)