Skip to content

Commit

Permalink
Don't run Rails 7.2 on Ruby 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rosston committed Sep 25, 2024
1 parent c1da259 commit 497d90d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 25 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ jobs:
strategy:
matrix:
ruby-version: ['3.0', '3.3']
gemfile: ['Gemfile', 'Gemfile_rails71']
exclude:
# Rails 7.2 requires Ruby 3.1+
- ruby-version: '3.0'
gemfile: 'Gemfile'

steps:
- uses: actions/checkout@v4
Expand All @@ -18,4 +23,4 @@ jobs:
bundler-cache: true

- name: Run tests
run: ./script/test
run: ./script/test ${{matrix.gemfile}}
2 changes: 1 addition & 1 deletion script/test
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cd ..

echo "---> Running tests"
bundle exec rake
./script/test_example_app
BUNDLE_GEMFILE="${1-Gemfile}" ./script/test_example_app

bundle exec rake test

Expand Down
36 changes: 13 additions & 23 deletions script/test_example_app
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,17 @@

set -e

run_example_tests() {
bundle
yarn install

# test a normal test run
bundle exec rake db:test:prepare
NODE_OPTIONS=--openssl-legacy-provider RAILS_ENV=test bundle exec rake assets:precompile
bundle exec rake cypress:run

# test that passing options works (by printing help)
if ! bundle exec rake cypress:run CYPRESS_RAILS_CYPRESS_OPTS="-h" | grep -q "Usage: cypress run \[options\]"; then
echo "Failed to pass options to cypress run"
exit 1
fi
}


cd example

echo "---> Running example tests with default Gemfile"
run_example_tests

echo "---> Running example tests with Gemfile.rails71"
BUNDLE_GEMFILE=Gemfile.rails71 run_example_tests
bundle
yarn install

# test a normal test run
bundle exec rake db:test:prepare
NODE_OPTIONS=--openssl-legacy-provider RAILS_ENV=test bundle exec rake assets:precompile
bundle exec rake cypress:run

# test that passing options works (by printing help)
if ! bundle exec rake cypress:run CYPRESS_RAILS_CYPRESS_OPTS="-h" | grep -q "Usage: cypress run \[options\]"; then
echo "Failed to pass options to cypress run"
exit 1
fi

0 comments on commit 497d90d

Please sign in to comment.