Skip to content

Commit 468b6ba

Browse files
committed
improve workflows
1 parent ca9c54a commit 468b6ba

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

.github/workflows/dart_daily_test.yml

+13-2
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,16 @@ jobs:
2121
- name: Install dependencies
2222
run: dart pub get
2323

24-
- name: Run tests
25-
run: dart test -n "Daily Exercises" --reporter expanded # Run all tests
24+
- name: Run tests and capture output
25+
run: |
26+
dart test -n "Daily Exercises" --reporter json > test_results.json || true
27+
28+
- name: Count passed and failed tests
29+
run: |
30+
PASSED_TESTS=$(grep -o '"result":"success"' test_results.json | wc -l)
31+
FAILED_TESTS=$(grep -o '"result":"failure"' test_results.json | wc -l)
32+
TOTAL_TESTS=$((PASSED_TESTS + FAILED_TESTS))
33+
34+
echo "✅ Passed tests: $PASSED_TESTS" >> $GITHUB_STEP_SUMMARY
35+
echo "❌ Failed tests: $FAILED_TESTS" >> $GITHUB_STEP_SUMMARY
36+
echo "📊 Total tests: $TOTAL_TESTS" >> $GITHUB_STEP_SUMMARY

.github/workflows/dart_test.yml

+13-2
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,16 @@ jobs:
2121
- name: Install dependencies
2222
run: dart pub get
2323

24-
- name: Run tests
25-
run: dart test -n "Other Exercises" --reporter expanded # Run all tests
24+
- name: Run tests and capture output
25+
run: |
26+
dart test -n "Other Exercises" --reporter json > test_results.json || true
27+
28+
- name: Count passed and failed tests
29+
run: |
30+
PASSED_TESTS=$(grep -o '"result":"success"' test_results.json | wc -l)
31+
FAILED_TESTS=$(grep -o '"result":"failure"' test_results.json | wc -l)
32+
TOTAL_TESTS=$((PASSED_TESTS + FAILED_TESTS))
33+
34+
echo "✅ Passed tests: $PASSED_TESTS" >> $GITHUB_STEP_SUMMARY
35+
echo "❌ Failed tests: $FAILED_TESTS" >> $GITHUB_STEP_SUMMARY
36+
echo "📊 Total tests: $TOTAL_TESTS" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)