traderepublic / Cilicon

🛠️ Self-Hosted ephemeral macOS CI on Apple Silicon

self-hosted selfhosted swift virtualization self-hosted-runner ci github-actions m1 m2 macos silicon swiftui

Cilicon: Self-Hosted ephemeral macOS CI on Apple Silicon

Cilicon is a self-hosted GitHub Action that allows you to run your macOS CI jobs on ephemeral macOS virtual machines on Apple Silicon. This provides a number of benefits over using GitHub's hosted macOS runners, including:

  • Ephemeral VMs: Each CI job runs on a fresh, ephemeral VM, so you don't have to worry about the state of the VM from previous jobs. This makes it easier to debug and troubleshoot your builds.
  • Apple Silicon: Cilicon uses Apple Silicon VMs, which provide significantly better performance than Intel-based VMs. This can save you time on your CI builds and allow you to run more complex tests.
  • Customizable: You can customize the macOS VM image used by Cilicon to match your specific needs. This gives you more control over the environment in which your CI jobs run.

Getting Started

To use Cilicon, you first need to set up a self-hosted runner on your macOS machine. You can find instructions on how to do this in the GitHub documentation. Once you have a self-hosted runner set up, you can add the following to your .github/workflows/*.yml file:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: apple-silicon-ci/cilicon@v1
        with:
          # The Xcode version to use
          xcode-version: '14.2'
          # The macOS version to use (defaults to 'latest')
          macos-version: 'latest'
          # The amount of memory to allocate to the VM (defaults to '8gb')
          memory: '8gb'
          # The number of CPUs to allocate to the VM (defaults to '2')
          cpus: '2'
          # The path to the Xcode project (defaults to 'Package.swift')
          project: 'Package.swift'
          # The scheme to build (defaults to the target name)
          scheme: 'MyTarget'
          # Additional arguments to pass to xcodebuild
          extra-args: '-workspace MyWorkspace.xcworkspace'

Features

Cilicon supports the following features:

  • Xcode: Cilicon uses Xcode to build your macOS projects. This means that you can use all of the features of Xcode, including building for multiple architectures, running unit tests, and generating code coverage reports.
  • Swift Packages: Cilicon supports building Swift packages. This allows you to easily test and distribute your Swift code.
  • Customizable: You can customize the macOS VM image used by Cilicon to match your specific needs. This gives you more control over the environment in which your CI jobs run.

Benefits

Using Cilicon provides a number of benefits over using GitHub's hosted macOS runners, including:

  • Performance: Cilicon uses Apple Silicon VMs, which provide significantly better performance than Intel-based VMs. This can save you time on your CI builds and allow you to run more complex tests.
  • Reliability: Cilicon uses ephemeral VMs, which means that each CI job runs on a fresh, clean VM. This reduces the risk of errors and failures caused by the state of the VM from previous jobs.
  • Flexibility: Cilicon is customizable, so you can use it to build and test your macOS projects in the way that best suits your needs.

Pricing

Cilicon is free to use. There are no charges for using the service or for running CI jobs on Apple Silicon VMs.

Support

If you have any questions or problems using Cilicon, please open an issue on the GitHub repository.