Better Programming

Advice for programmers.

Follow publication

Creating a Complete GitHub Workflow for Flutter

The fastest and easiest way to build and test your Flutter app

Edson Moisinho
Better Programming
Published in
9 min readMay 31, 2022
Photo by Sebastian Voortman at Pexels

In this article I will show how to set a simple and easy Flutter workflow that will:

  • Build your source code
  • Run unit tests
  • Upload the code coverage
  • Run integrated tests
  • Generate and upload an APK file
  • Take integrated tests screenshots and upload the files

If you’re not a Medium paid member, you can read this story for free using the following link

Create our Flutter example app

Before creating our workflow we need one app, and for now, the default template is enough

Create a new Flutter app and run it in an android emulator or physical device.

I have named my project as flutter_workflow_example

Flutter default app

Next, create a new GitHub repository and push all the code to it.

Git Hub Actions

A GitHub Action is a free CI/CD platform that allows workflow creation for building, testing, publishing, and many other possibilities completely integrated with GitHub.

Users can collaboratively create and share new actions on the platform which is a smart and efficient way of promoting collaboration and code reuse.

Creating a GitHub Action for your Flutter app is simple and straightforward, and it could be done in seconds, so let’s create our workflow, and then I will explain it step by step how it works:

First, create the .github/workflows/main.yml file, and paste the code below on it:

name: Flutter Workflow

on: [push, workflow_dispatch]
jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '2.10.0'
channel: 'stable'

- name…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Edson Moisinho
Edson Moisinho

Written by Edson Moisinho

A Software Engineer writing about programming, technology, and lifestyle

Responses (2)

Write a response