diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 868b76e2..d305b27c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,6 +2,8 @@ name: test on: push: + branches: + - main pull_request: jobs: @@ -26,8 +28,7 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} - - name: Install dependencies - run: bundle install + bundler-cache: true - name: Run tests run: bundle exec rspec @@ -54,6 +55,7 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} + bundler-cache: true - name: Startup MySQL run: | sudo systemctl start mysql.service @@ -61,8 +63,6 @@ jobs: run: | mysql --user=root --password=root --host=127.0.0.1 -e 'create database ransack collate utf8_general_ci;'; mysql --user=root --password=root --host=127.0.0.1 -e 'use ransack;show variables like "%character%";show variables like "%collation%";'; - - name: Install dependencies - run: bundle install - name: Run tests run: bundle exec rspec @@ -105,11 +105,10 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} + bundler-cache: true - name: Setup databases run: | psql -h localhost -p 5432 -W postgres -c 'create database ransack;' -U postgres; - - name: Install dependencies - run: bundle install - name: Run tests run: bundle exec rspec @@ -121,8 +120,7 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: 3.1.2 - - name: Install dependencies - run: bundle install + bundler-cache: true - name: Run bug report templates run: | ruby bug_report_templates/test-ransacker-arel-present-predicate.rb