Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continuous Integration (w/ Travis CI) #213

Merged
merged 3 commits into from
May 23, 2017
Merged

Continuous Integration (w/ Travis CI) #213

merged 3 commits into from
May 23, 2017

Conversation

swiftlyfalling
Copy link
Collaborator

@swiftlyfalling swiftlyfalling commented May 22, 2017

This PR provides extensive Travis-CI support for testing GRDB's many supported combinations:

GRDB

Scheme Xcode Version Tested On Notes
GRDBOSX Xcode 8.3 macOS 10.12
GRDBOSX Xcode 8.1 macOS 10.12
GRDBWatchOS Xcode 8.3 n/a (build only)
GRDBiOS Xcode 8.3 iOS 10.3 (maximum supported iOS)
GRDBiOS Xcode 8.3 iOS 8.1 (minimum supported iOS)
GRDBiOS Xcode 8.1 iOS 10.1 (max iOS for Xcode 8.1)

GRDB + Custom SQLite

Scheme Xcode Version Tested On Notes
GRDBCustomSQLiteOSX Xcode 8.3 macOS 10.12
GRDBCustomSQLiteOSX Xcode 8.1 macOS 10.12
GRDBCustomSQLiteiOS Xcode 8.3 iOS 10.3 (maximum supported iOS)
GRDBCustomSQLiteiOS Xcode 8.3 iOS 8.1 (minimum supported iOS)
GRDBCustomSQLiteiOS Xcode 8.1 iOS 10.1 (max iOS for Xcode 8.1)

GRDB + SQLCipher

Scheme Xcode Version Tested On Notes
GRDBCipherOSX Xcode 8.3 macOS 10.12
GRDBCipherOSX Xcode 8.1 macOS 10.12
GRDBCipheriOS Xcode 8.3 iOS 10.3 (maximum supported iOS)
GRDBCipheriOS Xcode 8.3 iOS 8.1 (minimum supported iOS)
GRDBCipheriOS Xcode 8.1 iOS 10.1 (max iOS for Xcode 8.1)

Installation

Installation Method Make Command
Manual Install make test_install_manual
Manual Install - GRDBCipher make test_install_GRDBCipher
CocoaPods Lint make test_CocoaPodsLint
SPM make test_install_SPM

General Information and Enhancements:

  • The .travis.yml file uses the Makefile to run all tests.
  • Tests are called individually to allow for easier identification of what combo(s) failed. (Instead of just running make test as a single job).
  • The Makefile has been enhanced to:
    • Use xcpretty, if it is available, for better logs on Travis-CI (and also to ensure that the 4MB log limit isn't hit due to lots of unnecessary / unimportant build output).
    • Use xcpretty-travis-formatter if running on Travis-CI (which enables collapsible sections and more when browsing logs).
    • Detect the version of Xcode that will be run, and configure the MAX_IOS_DESTINATION appropriately. Presets are included for Xcode 8.3.x, 8.2.x, and 8.1.x. Thus, the makefile can now be used with all GRDB-supported versions of Xcode.
  • The .ruby-version file has been removed from the repo + added to the .gitignore.
    • (If the .ruby-version file is present and contains a version of Ruby greater than Travis-CI supports, it will break the Travis-CI builds.)
  • A gemfile is provided for Travis-CI builds in a new .ci/gemfiles/ directory.
  • The .travis.yml file specifies a TID= environment variable for each test. This is simply to provide a description in the Travis-CI interface that identifies the job's details.

Other Notes:

  • Travis-CI's Xcode 8.1-8.3 images are all based on macOS 10.12. Hence, at the moment, this only tests the macOS Schemes on macOS 10.12.
  • The GRDBCipher tests are much slower than many of the others. Once groue/sqlcipher is rebased using the latest SQLCipher (which uses a much newer SQLite) this should speed up.
  • The testing stages are:
    1. Test GRDB
    2. Test GRDB + Custom SQLite
    3. Test GRDB + SQLCipher
    4. Test Installation Methods
  • Individual jobs within a testing stage are run in parallel (up to the concurrent job limit). All jobs in a stage must complete before the next stage begins.

Updating Guidelines for new Xcode versions

  • Update the Makefile:
    • Add a new MAX_IOS_DESTINATION condition for $(XCODEVERSION) 8.4 / 9.0 / etc
  • Edit the .travis.yml file (once Travis-CI officially supports the new Xcode version):
    • Decide whether to change all the osx_image: xcode8.3 jobs to osx_image: xcode8.4 (or whatever the future version is), or to add new jobs to additionally test the new Xcode version.
    • If GRDB's minimum supported Xcode version must change, update the osx_image: xcode8.1 jobs.

Setting up Travis-CI

  1. Go to https://travis-ci.org, and sign-in with your GitHub account.
  2. Go to https://travis-ci.org/profile/ and enable Travis-CI for groue/GRDB.swift
  3. Go to the Travis-CI settings page for groue/GRDB.swift. These are the settings I'd suggest:
    • Build only if .travis.yml is present: ON
    • Build branch updates: ON
    • Build pull request updates: ON
    • Limit concurrent jobs: OFF (This isn't necessary with how things are configured)
    • Auto cancel branch builds: ON
    • Auto cancel pull request builds: ON

If the .ruby-version file is present and contains a version of Ruby
greater than Travis-CI supports, it will break the Travis-CI builds.
@groue groue mentioned this pull request May 22, 2017
@swiftlyfalling
Copy link
Collaborator Author

swiftlyfalling commented May 22, 2017

@groue: If you want to see what the results look like, here's a link to the latest CI run on my branch. Click on one of the jobs and check out the job log - the Build and Test stages are collapsed by default.

@groue groue merged commit 676a116 into groue:master May 23, 2017
@groue
Copy link
Owner

groue commented May 23, 2017

@swiftlyfalling A PR from you is always a big present. Thank you!

@groue
Copy link
Owner

groue commented May 23, 2017

How could I live without xcpretty??? 😄

@swiftlyfalling
Copy link
Collaborator Author

Yep, xcpretty is pretty fantastic. 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants