I am trying to setup CI for my flutter project on gitlab but I don't understand where to start or what I have to do. Can anyone help me? Thanks
Both tools come with their pros and cons. While Gitlab gets an edge in code collaboration and version control, Jenkins fares well in continuous integration. As such, you cannot rate one tool over the other in the Gitlab vs Jenkins CI/CD battle.
Gitlab CI uses the Gitlab Runners as their build executors. They are nothing but machines where your pipeline will be executed. In order for your Flutter pipeline to be executed, you will need to install, configure (if required) and register Gitlab Runner on a machine preferably a Mac machine for supporting the iOS builds in Flutter with Android.
From there, again navigate to the CI / CD Settings page in the browser. Copy the token from the “Set up a specific Runner manually > Use the following registration token during setup” and paste this into the terminal and press enter. On the resulting message, “Please enter the gitlab-ci description for this runner.”.
The most common CI Pipeline in the Mobile world is Build -> Test -> Deploy. But when using Flutter, we run a Unit Test and Widget Tests without building the entire app. Before a job is created, a new GitLab Configuration file .gitlab-ci.yml needs to be generated from the root source of your codebase.
In order for your Flutter pipeline to be executed, you will need to install, configure (if required) and register Gitlab Runner on a machine preferably a Mac machine for supporting the iOS builds in Flutter with Android. You can install software for the Gitlab Runner and register your mac machine following this documentation:
.gitlab-ci.yml in your repo root:
stages:
- test
tests:
image: cirrusci/flutter
stage: test
script:
- flutter test
I suggest to setup your GitLab CI integration for flutter treating the android
and ios
project folder by their own in order to build your APK
or IPA
or doing test with your GitLab CI.
To start having a clue on how to setup a CI for Android
and iOS
projects on GitLab
I'll suggest you these readings:
Android:
iOS
UPDATE: using Fastlane
I've the above solutions running on my apps and so I know they work. But I've found these interesting official docs for flutter using Fastlane
(they seem quite easier):
So I suggest to give them a try too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With