Skip to content

Commit

Permalink
Fix builds for Rails integration tests
Browse files Browse the repository at this point in the history
A couple of things changed recently that broke these for us:

- Rails 7.2 beta dropped support for Ruby < 3.1
- ffi dropped support for Rubygems < 3.3.22

To fix this we have switched from fetching the Rails version to
supplying them in the GitHub actions, at least until Rails 7.2 is out.

We have also updated Rubygems and bundler to new enough versions to
compile the ffi gem.

We also had to add the build-essential package into a later build step
as ffi seems to get built a second time - this is possibly incorrect and
will need looking into.

We should possibly decide to at least drop testing for end of life versions:

- Ruby 2.7.8
- Rails 5.2.8.1
  • Loading branch information
mec committed Jul 12, 2024
1 parent 8524dcf commit b8f97d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/rails-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
name: Compute outputs
run: |
rails_versions=$(curl https://rubygems.org/api/v1/versions/rails.json | jq 'group_by(.number[:1])[] | (.[0].number) | select(.[:1]|tonumber > 4)' | jq -s -c)
echo "RAILS_VERSIONS=$rails_versions" >> $GITHUB_OUTPUT
echo 'RAILS_VERSIONS=["5.2.8.1","6.1.7.8","7.1.3.4"]' >> $GITHUB_OUTPUT
build-rails:
strategy:
fail-fast: false
Expand Down Expand Up @@ -114,4 +114,4 @@ jobs:
contains(needs.*.result, 'failure')
|| contains(needs.*.result, 'cancelled')
|| contains(needs.*.result, 'skipped')
}}
}}
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ RUN apt-get update -qq && \
# Install Nokigiri version that supports Ruby 2.7.8
RUN gem install nokogiri -v 1.15.6

# add a newer version of Rubygems and Bundler
RUN gem install bundler:2.3.22
RUN gem update --system 3.3.22

# Install Rails
ARG RAILS_VERSION=7.1.3.2
RUN gem install rails -v ${RAILS_VERSION}
Expand All @@ -35,7 +39,7 @@ FROM base

# Install packages needed for running the tests
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y curl git && \
apt-get install --no-install-recommends -y build-essential curl git && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives

# Copy built artifacts: gems, application
Expand Down

0 comments on commit b8f97d6

Please sign in to comment.