CI for iOS with Fastlane
Build, lint, and test a Fastlane iOS application.
Use template →env:
BUNDLE_PATH: vendor/bundle
steps:
- label: ":bundler: Install dependencies"
key: deps
command: "bundle install --path $BUNDLE_PATH"
plugins:
- artifacts#v1.9.3:
upload: "$BUNDLE_PATH"
compressed: $BUNDLE_PATH.tgz
- label: ":fastlane: Test"
key: test
depends_on: deps
command: "bundle exec fastlane ios test"
env:
LC_ALL: "en_US.UTF-8"
artifact_paths:
- "fastlane/test_output/**/*"
plugins:
- artifacts#v1.9.3:
download: "$BUNDLE_PATH"
compressed: $BUNDLE_PATH.tgz
- label: ":buildkite: Annotate"
depends_on:
- deps
- test
allow_dependency_failure: true
plugins:
- junit-annotate#v2.4.1:
artifacts: fastlane/test_output/*.junit
- label: ":fastlane: Lint"
depends_on: deps
command: "bundle exec fastlane ios lint"
env:
LC_ALL: "en_US.UTF-8"
plugins:
- artifacts#v1.9.3:
download: "$BUNDLE_PATH"
compressed: $BUNDLE_PATH.tgz
- label: ":fastlane: Build"
key: build
depends_on: deps
command: "bundle exec fastlane ios build"
env:
LC_ALL: "en_US.UTF-8"
plugins:
- artifacts#v1.9.3:
download: "$BUNDLE_PATH"
compressed: $BUNDLE_PATH.tgz
- label: ":ios: Submit beta"
depends_on:
- deps
- build
branches: "beta beta/*"
command: "bundle exec fastlane ios beta"
env:
LC_ALL: "en_US.UTF-8"
plugins:
- artifacts#v1.9.3:
download: "$BUNDLE_PATH"
compressed: $BUNDLE_PATH.tgz
- Languages
- Ruby
- Use cases
- Continuous integration, Mobile application
- Platforms
- iOS
- Tools
- Fastlane
CI for iOS with Fastlane
This template gives you a continuous integration (CI) pipeline that runs an iOS project using fastlane.
At a glance:
- For iOS projects
- Uses fastlane
How it works
This template:
- Installs dependencies using bundler.
- Runs fastlane lanes:
- Adds any test failures as annotations using junit-annotate-buildkite-plugin.
After the depedencies are installed, the lint, test, and build steps all run in parallel. After the build step has completed, the beta
step runs on beta
and beta/*
branches.
Note, depending on your version of Xcode you may need to install xcbeautify
, which is the recommended xcodebuild
formatter.
Next steps
After you select Use template, you’ll:
- Connect the Git repository for your iOS project.
- Check the commands match the lanes in your
Fastfile
(see the example). - Configure the compute—run locally, on-premises, or in the cloud.
- Install fastlane on your compute agents.
- Set up your Fastfile with the following actions:
- Run the pipeline.
You can then play around with the pipeline settings. For example, run the pipeline locally while you iterate on the definition or set a schedule to trigger a nightly build.
If you need help, please check our documentation, raise an issue , or reach out to support.