diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a1227fc..2732da1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 @@ -18,4 +23,4 @@ jobs: bundler-cache: true - name: Run tests - run: ./script/test + run: ./script/test ${{matrix.gemfile}} diff --git a/script/test b/script/test index cc27cf4..a31d134 100755 --- a/script/test +++ b/script/test @@ -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 diff --git a/script/test_example_app b/script/test_example_app index 1a0f673..eebbf21 100755 --- a/script/test_example_app +++ b/script/test_example_app @@ -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