-
Notifications
You must be signed in to change notification settings - Fork 196
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
Apple Silicon CI Resource Class #434
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/bash -eo pipefail | ||
|
||
# Ensure any error stops the script | ||
set -e | ||
|
||
# Check if Homebrew is installed | ||
if ! command -v brew &> /dev/null; then | ||
echo "Homebrew not found. Please install it first." | ||
exit 1 | ||
fi | ||
|
||
# Check if rbenv is installed; if not, install it | ||
if ! command -v rbenv &> /dev/null; then | ||
echo "Installing rbenv..." | ||
brew install rbenv | ||
# Check if rbenv init line is already present in .bash_profile, if not, add it | ||
if ! grep -q 'eval "$(rbenv init -)"' ~/.bash_profile; then | ||
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile | ||
fi | ||
|
||
source ~/.bash_profile | ||
else | ||
echo "rbenv is already installed." | ||
fi | ||
|
||
# Check if ruby-build is installed; if not, install it | ||
if ! brew list ruby-build &> /dev/null; then | ||
echo "Installing ruby-build..." | ||
brew install ruby-build | ||
else | ||
echo "ruby-build is already installed." | ||
fi | ||
|
||
# Ensure ruby-build is up-to-date | ||
brew update && brew upgrade ruby-build | ||
|
||
# Check if Ruby 3.0.6 is already installed; if not, install it | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We reference Ruby 3.0.6 a bunch of times in this file and the next. Can we use a standard .ruby-version file in the project, which rbenv will respect, so we don't need to manually reference it everywhere? |
||
if ! rbenv versions | grep -q 3.0.6; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We might be able to avoid a lot of (all of?) this script because it looks like Circle has support for switching between modern rubies: https://circleci.com/docs/testing-ios/#using-ruby |
||
echo "Installing Ruby 3.0.6..." | ||
rbenv install 3.0.6 | ||
else | ||
echo "Ruby 3.0.6 is already installed." | ||
fi | ||
|
||
# Set the global Ruby version to 3.0.6 | ||
echo "Setting global Ruby version to 3.0.6..." | ||
rbenv global 3.0.6 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash -eo pipefail | ||
|
||
# Ensure any error stops the script | ||
set -e | ||
|
||
# Ensure rbenv is properly initialized | ||
if ! command -v rbenv &> /dev/null; then | ||
echo "rbenv not found. Please install it first." | ||
exit 1 | ||
fi | ||
|
||
echo "Initializing rbenv..." | ||
source ~/.bash_profile | ||
|
||
# Set the global Ruby version to 3.0.6 | ||
echo "Setting global Ruby version to 3.0.6..." | ||
rbenv global 3.0.6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can safely ditch Xcode 13 and just test 14.