Skip to content

Instantly share code, notes, and snippets.

@bamnet
Created June 27, 2025 04:25
Show Gist options
  • Save bamnet/c5d7681102b0adebbe6933cce7464328 to your computer and use it in GitHub Desktop.
Save bamnet/c5d7681102b0adebbe6933cce7464328 to your computer and use it in GitHub Desktop.
Flutter CI/CD
image: ghcr.io/cirruslabs/flutter:latest
stages:
- test
- deploy
unit_tests:
stage: test
cache:
- key:
files:
- pubspec.yaml
paths:
- ~/.pub-cache
script:
- flutter test packages/*
- flutter test --coverage
- lcov --remove coverage/lcov.info 'lib/generated/*' --output-file coverage.info
- lcov --list coverage.info
deploy_android:
stage: deploy
when: manual
cache:
- key:
files:
- android/Gemfile.lock
paths:
- vendor/ruby
script:
# Download the GitLab secure files at [SECURE_FILES_DOWNLOAD_PATH]
- curl --silent "https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files/-/raw/main/installer" | bash
# Move the key file into the android directory.
- cp .secure_files/key.properties android/
- cp .secure_files/keystore.jks android/
# Fastlane!
- cd android/fastlane
- gem install bundler
- bundle config set --local path 'vendor/ruby'
- bundle install
- bundle exec fastlane internal
## Gitlab does not support macOS runners for free accounts.
# deploy_ios:
# image: macos-14-xcode-15
# tags:
# - saas-macos-medium-m1
# stage: deploy
# when: manual
# cache:
# - key:
# files:
# - android/Gemfile.lock
# paths:
# - vendor/ruby
# script:
# - cd ios/fastlane
# - gem install bundler
# - bundle config set --local path 'vendor/ruby'
# - bundle install
# - bundle exec fastlane beta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment