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

use osx on travis-ci? #494

Closed
AlJohri opened this issue Jun 21, 2017 · 6 comments
Closed

use osx on travis-ci? #494

AlJohri opened this issue Jun 21, 2017 · 6 comments

Comments

@AlJohri
Copy link
Contributor

AlJohri commented Jun 21, 2017

I'm curious why you don't currently try actually running the mac script on travis?

@AlJohri
Copy link
Contributor Author

AlJohri commented Jun 21, 2017

nevermind, just tried this myself and that didn't seem like it was ever going to end

@AlJohri AlJohri closed this as completed Jun 21, 2017
@AlJohri
Copy link
Contributor Author

AlJohri commented Jun 21, 2017

reopening this. I got it working in 24 minutes for my fork of laptop which does a bunch more stuff. https://travis-ci.org/WPMedia/laptop/builds/245425407

here is a travis ci config that works:

language: generic
os: osx
osx_image: xcode8.3

install:
  - brew install shellcheck

script:
  - shellcheck mac -e SC2039
  - ./mac

matrix:
  fast_finish: true

notifications:
  email: false

The only change I needed to make was adding sudo to the chsh command and appending "$USER" at the end of it.

@AlJohri AlJohri reopened this Jun 21, 2017
@gohanlon
Copy link
Contributor

@AlJohri Running the mac script on Travis CI seems like win. Cool!

In case it saves someone a minute, Al’s related work on the WPMedia fork:

@AlJohri
Copy link
Contributor Author

AlJohri commented Jun 21, 2017

@gohanlon thanks!

One other change I made which wasn't necessary but sped things up a bit was using the travis binary for ruby instead of compiling it on the fly: https://github.com/WPMedia/laptop/blob/b1f6ea5640932cfab2725b8749c24a19326c94e8/mac#L161-L169

if ! rbenv versions | grep -Fq "$ruby_version"; then
  if [ "$CI" == "true" ]; then
    wget "http://rubies.travis-ci.org/osx/10.12/x86_64/ruby-$ruby_version.tar.bz2"
    tar -xf "ruby-$ruby_version.tar.bz2"
    mv "ruby-$ruby_version" "$HOME/.rbenv/versions/$ruby_version"
  else
    RUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr/local/opt/openssl rbenv install -s "$ruby_version"
  fi
fi

@gohanlon
Copy link
Contributor

Waiting for Ruby builds is no fun. Although I’m torn, I lean towards not applying that speedup.

The speedup is no doubt huge and is only substituting a step that should already be well tested outside of Laptop.

But, sometimes ruby-build builds do break, especially around the time of new macOS or Xcode releases, and knowing that the build Laptop depends on is broken would be useful (even though there’s almost certainly nothing to be done within Laptop to fix it).

Side note: I think using openssl from homebrew is a default ruby-build behavior, so Laptop could remove the RUBY_CONFIGURE_OPTS. Maybe that'd be a good first test to run on Travis CI?

croaky added a commit that referenced this issue Aug 4, 2017
* Move off Travis to Circle.
* Run the entire script on macOS infrastructure.

We're cheating slightly with this implementation,
but seems worth it for speed of build tradeoff:

* Use pre-installed XCode for compilers, etc.
* Use pre-installed Ruby version.

Related:

#494
@croaky
Copy link
Contributor

croaky commented Aug 4, 2017

Thanks, folks! I've just opened #501

I chose Circle over Travis for this use case because we're already paying for a Circle plan for macOS infrastructure for our internal iOS / React Native work.

Thank you for that chsh change @AlJohri!

@croaky croaky closed this as completed Aug 4, 2017
croaky added a commit that referenced this issue Aug 8, 2017
* Move off Travis to Circle.
* Run the entire script on macOS infrastructure.
* Performance optimization:
  Enforce a Ruby version to skip Ruby install

We're cheating slightly with this implementation,
but seems worth it for speed of build tradeoff:

* Use pre-installed XCode for compilers, etc.
* Use pre-installed Ruby version.

Related:

#494
croaky added a commit that referenced this issue Aug 8, 2017
* Move off Travis to Circle.
* Run the entire script on macOS infrastructure.
* Performance optimization:
  Enforce a Ruby version to skip Ruby install

We're cheating slightly with this implementation,
but seems worth it for speed of build tradeoff:

* Use pre-installed XCode for compilers, etc.
* Use pre-installed Ruby version.

Related:

#494
gerardo pushed a commit to gerardo/laptop that referenced this issue May 26, 2018
* Move off Travis to Circle.
* Run the entire script on macOS infrastructure.
* Performance optimization:
  Enforce a Ruby version to skip Ruby install

We're cheating slightly with this implementation,
but seems worth it for speed of build tradeoff:

* Use pre-installed XCode for compilers, etc.
* Use pre-installed Ruby version.

Related:

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

No branches or pull requests

3 participants