CI for iOS with Fastlane
Build, lint, and test a Fastlane iOS application.
Use template →1env:
2 BUNDLE_PATH: vendor/bundle
3
4steps:
5 - label: ":bundler: Install dependencies"
6 key: deps
7 command: "bundle install --path $BUNDLE_PATH"
8 plugins:
9 - artifacts#v1.9.3:
10 upload: "$BUNDLE_PATH"
11 compressed: $BUNDLE_PATH.tgz
12
13 - label: ":fastlane: Test"
14 key: test
15 depends_on: deps
16 command: "bundle exec fastlane ios test"
17 env:
18 LC_ALL: "en_US.UTF-8"
19 artifact_paths:
20 - "fastlane/test_output/**/*"
21 plugins:
22 - artifacts#v1.9.3:
23 download: "$BUNDLE_PATH"
24 compressed: $BUNDLE_PATH.tgz
25
26 - label: ":buildkite: Annotate"
27 depends_on:
28 - deps
29 - test
30 allow_dependency_failure: true
31 plugins:
32 - junit-annotate#v2.4.1:
33 artifacts: fastlane/test_output/*.junit
34
35 - label: ":fastlane: Lint"
36 depends_on: deps
37 command: "bundle exec fastlane ios lint"
38 env:
39 LC_ALL: "en_US.UTF-8"
40 plugins:
41 - artifacts#v1.9.3:
42 download: "$BUNDLE_PATH"
43 compressed: $BUNDLE_PATH.tgz
44
45 - label: ":fastlane: Build"
46 key: build
47 depends_on: deps
48 command: "bundle exec fastlane ios build"
49 env:
50 LC_ALL: "en_US.UTF-8"
51 plugins:
52 - artifacts#v1.9.3:
53 download: "$BUNDLE_PATH"
54 compressed: $BUNDLE_PATH.tgz
55
56 - label: ":ios: Submit beta"
57 depends_on:
58 - deps
59 - build
60 branches: "beta beta/*"
61 command: "bundle exec fastlane ios beta"
62 env:
63 LC_ALL: "en_US.UTF-8"
64 plugins:
65 - artifacts#v1.9.3:
66 download: "$BUNDLE_PATH"
67 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.