Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

apomalyn/flutter_project_template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flutter_project_template

Version Coverage Badge

This repository is a template of CI for Flutter project.

What this repo offer?

Feature type Name Description Implementation status
CI Version tag validation Check if the version of the application has been changed on each PR. CI Doc
CI Test and checks Run flutter test, flutter analyze and flutter format on each PR. CI Doc
CI Coverage Comment the coverage percentage from lcov on each PR. Display the coverage percentage on a badge for the master branch CI Doc
CI Update goldens Sometimes updating goldens can be frustrating especially when you are multiple dev with different OS. The goal is to offer a simple way to update the goldens for everyone. CI Doc
CI Build Build the application for Android (aab), iOS (ipa), MacOS, Linux, Windows and web Android iOS Web MacOS Doc Linux Windows
CI Github release When a PR lands in main branch, create a draft release (can be a pre-release also, your choice) with an automatic changelog and it's own version. CI Doc
CD Store release When a github release is published, the application should be sent to the stores. Google Play Store iOS Doc

Use the CI

Setup gist for the code coverage badge

Big thanks to The Jared Wilcurt for the technique explained here.

  1. First you need to create a public gist in Github gist. Copy the id of the gist (you can find it in the URL just after your username).
  2. Create a secret called GIST_ID_COVERAGE_BADGE with the ID of the created gist as value.
  3. Create a developer token with the gist scope. Copy the token.
  4. Create a secret called GIST_COVERAGE_BADGE_TOKEN with the token just created at the previous step as value.
  5. Do not forget to copy scripts/ci_determine_coverage_percentage.sh in your repository.
  6. Add this badge to your README: [![Coverage Badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/<YOUR_USERNAME>/<YOUR_GIST_ID>/raw/<REPOSITORY_NAME>_master_badge_coverage.json)]
  7. There you go! 😄

Commit goldens files

When you wish to regenerate the goldens files of your project, simply add [CI UPDATE GOLDENS] to your commit message. The CI will update all the goldens files during the testing job then will push the new/updated files.

⚠️ Your goldens files have to be stored under the test folder of the project. Otherwise, update Commit golden files step under the testing job. ⚠️

Setup

  1. Create a developer token with the repo scope. Copy the token.
  2. Create a secret called PAT with the token just created at the previous step.
  3. Enjoy! 😄

Using the following actions