/SwiftlaneCI

Swiftlane based CI job runner example

Primary LanguageSwiftApache License 2.0Apache-2.0

SwiftlaneCI

This an example implementation of your CI jobs runner built with Swiftlane package.

This repo is just a minimal example showing how to get started with Swiftlane. We suggest you to check the code base of Swiftlane repo to get a better understanding what you can do with it.

What's inside

Simple CI job named test-calculator defined in UnitTestsLaneCommand.swift which will:

  • Build and run unit tests
  • Check for build errors
  • Check for build warnings
  • Check Coverage limits per Target (what percent of each target is covered)
  • Check Coverage limits for changed lines (what percent of changed lines is covered)
  • Produce a nice looking report.md in the Examples directory
  • In-code sample configs for all the tasks above

A bash script to run the job (Examples/simple_ci_job.sh) which will:

  • Clone and build xcbeautify & xclogparser into Examples/deps
  • Build and run SwiftlaneCI

After the run you will find a few artifacts inside Examples/swiftlane_builds subdirectories:

  • derived_data - derived data
  • logs:
    • system - simulator logs
    • test - xcodebuild logs
  • results:
    • *.xcresult - Xcode produced build & test results (which you can always open on another machine)
    • xclogparser_report.json - json build report generated by xclogperser
    • build_report_html - html build report generated by xclogperser
    • xccov_report.json - code coverage info generated by xccov
    • _merged_result.junit - JUnit unit testing report

Getting Started

Clone this repo:

$ git clone https://github.com/swiftlane-code/SwiftlaneCI
$ cd SwiftlaneCI

Try running the example CI job script:

$ cd Examples
$ ./simple_ci_job.sh

Customisation

The best way to customize the runner is to make a fork or a so-called private fork of this repo and modify it as you wish.

Review the configs at UnitTestsLaneCommand+Configs.swift & SharedConfigFactory.swift and change them to suit your needs.

Contributing

Swiftlane is an open-source project, and we welcome contributions from anyone who is interested in improving it. Whether you want to fix a bug, add a new feature, or just help with the documentation, we would love to have your help.

To contribute to Swiftlane, you can fork the repository, make your changes, and submit a pull request. We will review your changes and merge them if they meet our quality standards.

Keep in mind that this particular repo is kind of a starting scratch for everyone who is willing to build their CI jobs with Swiftlane.

License

Swiftlane is licensed under the Apache License 2.0.