Skip to content

Add Flutter CI: analyze, test, and coverage badge#25

Merged
hawkbee1 merged 3 commits intogame_clockfrom
copilot/add-github-action-flutter-test
Mar 27, 2026
Merged

Add Flutter CI: analyze, test, and coverage badge#25
hawkbee1 merged 3 commits intogame_clockfrom
copilot/add-github-action-flutter-test

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 27, 2026

No CI existed for this Flutter project. Adds a GitHub Actions workflow covering static analysis, testing, coverage reporting, and auto-updating README badges.

Workflow (.github/workflows/flutter_ci.yml)

Triggers on push and PRs targeting game_clock.

  • flutter analyze — static analysis/linting
  • flutter test --coverage — runs all unit and widget tests, emits coverage/lcov.info
  • Coverage extraction — parses line coverage % via lcov --summary
  • Badge update (push to game_clock only) — rewrites the coverage badge URL in README.md with colour thresholds: ≥80% brightgreen, ≥60% yellow, <60% red; commits back with [skip ci] to prevent loops

README badges

Two badges added at the top of README.md:

[![Tests](https://github.com/hawkbee1/game_clock_sandbox/actions/workflows/flutter_ci.yml/badge.svg?branch=game_clock)](...)
![Coverage](https://img.shields.io/badge/coverage-0%25-lightgrey)

The test badge reflects workflow pass/fail dynamically via GitHub's built-in badge endpoint. The coverage badge is updated in-place by the workflow on each push.


⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

Copilot AI linked an issue Mar 27, 2026 that may be closed by this pull request
@hawkbee1 hawkbee1 marked this pull request as ready for review March 27, 2026 13:35
Copilot AI changed the title [WIP] Add GitHub action to run Flutter tests and check code coverage Add Flutter CI: analyze, test, and coverage badge Mar 27, 2026
Copilot AI requested a review from hawkbee1 March 27, 2026 13:38
run: flutter analyze

- name: Run Flutter tests with coverage
run: flutter test --coverage
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot if tests fails continue to the next step

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 43845e3. Added continue-on-error: true to the test step so coverage extraction and badge update always run even when tests fail. A final step at the end of the job then exits with failure if the tests did fail, keeping the CI status badge accurate.

Copilot AI requested a review from hawkbee1 March 27, 2026 14:19
@hawkbee1 hawkbee1 merged commit 9df22eb into game_clock Mar 27, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add github action: run flutter test, check code coverage

2 participants