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

Support Ruby 3.2.2 #492

Merged
merged 3 commits into from
Jul 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 31 additions & 19 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Nodes with values to reuse in the pipeline.
common_params:
env: &xcode_image
IMAGE_ID: xcode-14.1
IMAGE_ID: xcode-14.3.1
plugins:
- &docker_plugin
docker#v3.8.0:
Expand All @@ -21,27 +21,39 @@ steps:
#################
# Build and Test
#################
- label: "🧪 Build and Test"
- group: 🧪 Build and Test"
key: test
command: |
# We only need this for tasks running on a Mac
brew install pkg-config git-lfs libxml2 imagemagick@6
steps:
- label: "🧪 Build and Test using Ruby {{ matrix.ruby }}"
command: |
echo "--- :ruby: Using ruby {{ matrix.ruby }}"
export RBENV_VERSION={{ matrix.ruby }}
ruby --version

echo "--- :git: Setting up git-lfs"
git-lfs install
echo "--- :package: Installing homebrew packages"
# We only need this for tasks running on a Mac
brew install pkg-config git-lfs libxml2 imagemagick@6

echo "--- :rubygems: Setting up Gems"
# https://github.com/Automattic/bash-cache-buildkite-plugin/issues/16
gem install bundler
install_gems
echo "--- :git: Setting up git-lfs"
git-lfs install

echo "--- :rspec: Run Rspec"
bundle exec rspec --profile 10 --format progress
env: *xcode_image
plugins:
- automattic/a8c-ci-toolkit#2.15.0
agents:
queue: "mac"
echo "--- :rubygems: Setting up Gems"
# https://github.com/Automattic/bash-cache-buildkite-plugin/issues/16
gem install bundler
install_gems

echo "--- :rspec: Run Rspec"
bundle exec rspec --profile 10 --format progress
env: *xcode_image
plugins:
- automattic/a8c-ci-toolkit#2.15.0
agents:
queue: "mac"
matrix:
setup:
ruby:
- 2.7.4
- 3.2.2
Comment on lines +52 to +56
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌


#################
# Lint
Expand Down Expand Up @@ -79,7 +91,7 @@ steps:
- test
- rubocop
- danger
# Note: We intentionally call a separate `.sh` script here (as opposed to having all the
# Note: We intentionally call a separate `.sh` script here (as opposed to having all the
# commands written inline) to avoid leaking a key used in the process in clear in the
# BUILDKITE_COMMAND environment variable.
command: .buildkite/gem-push.sh
Expand Down
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ require:
# Enable new cops when we update rubocop to a newer version
AllCops:
NewCops: enable
TargetRubyVersion: 2.7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not make rubocop enforce Ruby 3 rules right away? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That means we'll have to change the code to use Ruby 3 syntax or API to address the new rubocop issues. I don't think we should use Ruby 3 right now, because the apps are still using 2.7. Once a new release-toolkit is released (which contains all the fixes for the Ruby 3 compatibility), I'll try to upgrade a few apps to use Ruby 3. If all go well, we can then changing this library to require Ruby 3 and above. That's when we can drop 2.7 and let rubocop enforce Ruby 3 rules.


########## Lint / CodeStyle

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- Adds `if_exists` parameter to `upload_to_s3` action, with possible values `:skip`, `:fail`, and `:replace`. [#495]
- The `create_release` action now prints and returns the URL of the created GitHub Release. [#503]
- Removes two dependencies bigdecimal and activesupport. [#504]
- Supports Ruby 3. [#492, #493, #497, and #504]

### Bug Fixes

Expand Down