Our favorite GitHub Actions for Flutter apps

GitHub Actions are somewhat underutilized tools that can supercharge app development.

1 min read

GitHub Actions are somewhat underutilized tools that can supercharge app development. If you haven’t used them before, we highly recommend that you do so, especially with open source projects (since they have unlimited build minutes). With just a few lines, you can automate tasks that you would otherwise have to do manually with each build, save some time, and prevent errors!

Our favorite GitHub Actions to use with Flutter app projects are:

  1. Flutter GitHub Action: Gives you access to the Flutter command line so that you can format, analyze, and test your flutter code. It also allows you to specify which version and channel of flutter you want to use so that you can run your tests against the stable, beta, dev, or master channels.
  2. Upload Artifact: Upload coverage reports and visual architecture documents to GitHub. We use this to upload a visual representation of the app architecture, test coverage reports, and other important docs we may want to view after a workflow has run.
  3. Very Good Coverage: We made this one to keep track of our test coverage and ensure that we’re not slipping below our 100% threshold. You can specify any  threshold up front to ensure that your coverage never dips below your desired limit. Check out how we built it in this blog post.
  4. Simple cspell: We use this one to run a quick spell check on builds. Unknown words are displayed as annotations so you can review and update any spellings accordingly. Don’t worry, you can whitelist any unique words so they don’t get flagged.

How to use GitHub Actions

First, view the full documentation for GitHub Actions. Once you’re ready, specify a workflow yaml file with the actions you want to use, then build and push changes as usual — it’s that simple!

Frequently Asked Questions

Which GitHub Actions does VGV recommend for Flutter projects?

Four. Flutter GitHub Action for running format, analyze, and test commands, Upload Artifact for storing coverage reports and architecture docs, Very Good Coverage for enforcing coverage thresholds, and Simple cspell for spell-checking builds.

What does the Flutter GitHub Action do?

It gives the workflow access to the Flutter command line so you can run format, analyze, and test against any specified Flutter version and channel. It supports stable, beta, dev, and master channels.

What is Very Good Coverage?

Very Good Coverage is a GitHub Action VGV built to track test coverage and fail builds when coverage drops below a configured threshold. VGV uses it to keep their projects at 100% coverage. See how it was built.

Why use GitHub Actions for open source projects?

Open source repositories on GitHub get unlimited build minutes for Actions, so the cost of running CI checks on every push and PR is zero. A few lines of YAML can automate the manual checks teams would otherwise run by hand on every build.