Skip to content

add exercise

add exercise #7

Workflow file for this run

name: Dart Tests
on:
push: # Run tests on every push
branches: [ master ] # Change 'main' to your branch if needed
pull_request: # Run tests on PRs
jobs:
test:
runs-on: ubuntu-latest # Use the latest Ubuntu environment
steps:
- name: Checkout repository
uses: actions/checkout@v4 # Get the latest code
- name: Setup Dart
uses: dart-lang/setup-dart@v1
with:
sdk: stable # Use stable Dart SDK
- name: Install dependencies
run: dart pub get
- name: Run tests and capture output
run: |
dart test -n "Other Exercises" --reporter json > test_results.json || true
- name: Count passed and failed tests
run: |
PASSED_TESTS=$(grep -o '"result":"success"' test_results.json | wc -l)
FAILED_TESTS=$(grep -o '"result":"failure"' test_results.json | wc -l)
TOTAL_TESTS=$((PASSED_TESTS + FAILED_TESTS))
echo "✅ Passed tests: $PASSED_TESTS" >> $GITHUB_STEP_SUMMARY
echo "❌ Failed tests: $FAILED_TESTS" >> $GITHUB_STEP_SUMMARY
echo "📊 Total tests: $TOTAL_TESTS" >> $GITHUB_STEP_SUMMARY