How GitHub reduced testing time for iOS apps with new runner features

Learn how GitHub used macOS and Apple Silicon runners for GitHub Actions to build, test, and deploy our iOS app faster.

Eli Perkins
4 min readintermediate
--
View Original

Overview

The article discusses how GitHub improved the testing efficiency of its iOS apps by utilizing new runner features, particularly the M1 macOS runners. By breaking down their monolithic testing workflow into smaller, independent jobs, they achieved a significant reduction in testing time from 38 minutes to 15 minutes, enhancing developer feedback and productivity.

What You'll Learn

1

How to leverage Apple silicon for faster CI testing

2

Why breaking down a monolithic codebase improves testing efficiency

3

How to implement modular testing in GitHub Actions

Key Questions Answered

How did GitHub reduce testing time for iOS apps?
GitHub reduced testing time by switching to M1 macOS runners and breaking down their testing workflow into separate jobs for each module. This change allowed them to decrease the overall testing time from 38 minutes to 15 minutes, significantly speeding up feedback for developers.
What are the benefits of using Apple silicon for CI?
Using Apple silicon improves build performance and reliability, allowing iOS teams to test natively across all Apple platforms. This avoids issues related to cross-compilation and ensures compatibility with the latest versions of iOS, iPadOS, watchOS, and tvOS.
What changes were made to the CI workflow?
The CI workflow was modified to separate the build and test processes for each module, allowing for faster feedback and easier identification of failures. This was achieved using xcodebuild’s build-without-testing and test-without-building commands.
How does GitHub Actions manage CI jobs?
GitHub Actions prepares the required number of machines to execute workflows by sending requests to its service, which assigns freshly reimaged virtual machines to execute the necessary jobs. This allows for efficient scaling of CI tasks.

Key Statistics & Figures

Reduction in testing time
60%
Testing time decreased from 38 minutes to 15 minutes after implementing modular testing with M1 macOS runners.
Fastest module test completion time
2-3 minutes
Some of the smallest modules completed their tests in as little as 2-3 minutes on M1 macOS runners.
Concurrent runners available for enterprise accounts
50
GitHub Actions offers 50 concurrent runners for enterprise accounts, facilitating parallel testing.

Technologies & Tools

Some links below are affiliate links. We may earn a commission if you make a purchase.

CI/CD
Github Actions
Used for automating the testing and deployment processes of the iOS app.
CI/CD
M1 Macos Runners
Utilized to enhance performance and reduce testing times for iOS applications.
Development Tool
Xcodebuild
Used for building and testing iOS applications within the CI workflow.

Key Actionable Insights

1
Implementing modular testing can drastically improve CI efficiency.
By breaking down the testing process into smaller modules, teams can receive faster feedback and address issues more quickly. This approach is particularly beneficial in large codebases with multiple components.
2
Utilizing the latest hardware can lead to significant performance gains.
Switching to M1 macOS runners allowed GitHub to reduce testing times by 60%, showcasing the importance of leveraging modern technology in development workflows.
3
Regularly analyze CI performance to identify bottlenecks.
By dividing CI tasks into build and test steps, teams can pinpoint slow tests and optimize them, leading to overall improved performance in the development cycle.

Common Pitfalls

1
Failing to modularize a large codebase can lead to inefficient testing.
When teams attempt to test monolithic applications, they often face long build times and delayed feedback. Modularizing allows for quicker iterations and easier debugging.