-
Notifications
You must be signed in to change notification settings - Fork 13
Self Hosted Github Actions
While Github Actions is being used on some iOS projects, the CI pipeline is not running on all pull requests because of the high pricing of runner minutes for iOS. So to support running the CI pipeline on all pull requests, we decide to use self-hosted runners with Github Actions.
GitHub Actions allows developers to set up a self-hosted runner in place of a Github-provided runner. A self-hosted runner can be either a local or cloud device.
Existing macOS devices can be used to run Github Actions Workflow by installing the runner and having the machine listen to the command from Github Actions.
These are remote computers, available to use as infrastructure-as-a-service or platform-as-a-service. They are more suitable to host the Github Actions runner as they are guaranteed to be online (as per the service’s terms). Covered in this guide is as MacStadium. Other services include:
A freshly rented MacStadium does not include all the tools needed to start a GitHub Actions for iOS development.
To install all the dependencies, follow these required steps:
-
Download Xcode and Xcode Command Line Tool from https://developer.apple.com/xcode/
-
Launch
Terminal
to install Ruby withgem update --system
. The current version used for writing this document isgem install bundler:2.2.15
. -
Connect Github Actions Runner to the machine.
-
Trigger a run from Github Console or git push.
-
During the first Github Actions runtime, some gems package will require machine password to install. This is referred to machine password in MacStadium when setting up the Mac.
The instruction for connecting Github Actions to the hosting machine should follow the instruction found in Settings > Actions > Runners > New self-hosted runner
in the projects repository page.
The general steps are:
- Download: Download the newest version of Github Runner and save in the runner folder.
- Configure: Inject the project’s token to the runner and run the executable.
To add more runners to the same or a new host, simply follow the instruction from the repository’s settings Settings > Actions > Runners > New self-hosted runner
. Make sure the new runner is downloaded onto a separate folder.
In the case that the machine is shut down or the terminal running the script was exited, the runner script can be relaunched by cd
to the script folder and run ./run.sh
.
When setting up successfully.
This project is maintained and funded by Nimble.