Skip to content

Github Actions CI CD

Xavier Chrétien edited this page Jun 27, 2021 · 2 revisions

To build, improve the code's quality, manage the generation of golden files and more (to come).

Main workflow

Currently, the main workflow (stored in .github/workflows/main-workflow.yaml) is triggered by two types of event: pull_request and push on the master branch. The workflow is divided into five (5) jobs.

Tag validation

Triggered by: pull request (opened and synchronized) and push into master.

Description: Retrieve the version of the application stored into the pubspec.yaml and validate if there is any tag with this version. If there is a tag existing with the same version, a comment will be posted on the pull request and the job will fail.

Tests and checks

Triggered by: pull request (opened and synchronized) and push into master.

Description: This job will run flutter format, flutter analyze and flutter test --coverage, if one of these steps fails the job will fail.

Special action: The CI can generate the golden files for you. In a pull request, add to the last commit [CI UPDATE GOLDENS], the CI will do the rest.

Coverage

Triggered by: pull request (opened and synchronized) and push into master.

Description: Half of this job will be run during a pull request and the other half on a push to master. The pull request parts will comment the content of the LCOV file generated during the previous job (Tests and checks). In a push to master, the CI will create a gist with a JSON file used by shield.io to generate the code coverage percentage badge.

Create X build

Triggered by: pull request (opened and synchronized) and push into master.

Description: TODO

Draft Github release

Triggered by: push into master.

Description: TODO