Setup CI on Gitlab for Flutter

9,476

Solution 1

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.

Solution 2

.gitlab-ci.yml in your repo root:

stages:
  - test

tests:
  image: cirrusci/flutter
  stage: test
  script:
  - flutter test

Share:
9,476
Pierre Le Brun
Author by

Pierre Le Brun

Updated on December 09, 2022

Comments

  • Pierre Le Brun
    Pierre Le Brun over 1 year

    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

  • shadowsheep
    shadowsheep over 5 years
    @PierreLeBrun I've also found (but not actually tried) some very nice docs (also official) using Fastlane. And fastlane could be easily integrated with GitLab. So give it a try!
  • Pierre Le Brun
    Pierre Le Brun over 5 years
    I have alreasy tried to use fastane and I suceeded in setting it up locally but have no idea how to move it to gitlab (using docker and such) so I was looking for alternatives. :)
  • Pierre Le Brun
    Pierre Le Brun over 5 years
    Thanks man, i didn't use fastlane but my CI works for android. Now I have a problem when i initialize gradle, can you help me or I create an other topic ?
  • shadowsheep
    shadowsheep over 5 years
    @PierreLeBrun best practice should be to create (or search if there is already one that target your issue) question. Btw I could help you with this issue too, if you post another question, let me know the link. I guess this should be tagged only GitLab and gradle and android or even gradle and android only.
  • Pierre Le Brun
    Pierre Le Brun over 5 years
    I create a new one (i don't find a topic on my issue). This is the link stackoverflow.com/questions/54424874/…