From 9178758feb720aaabb310d319b79821cf601249e Mon Sep 17 00:00:00 2001 From: Sean Carroll Date: Mon, 13 Jun 2022 00:33:21 +0200 Subject: [PATCH 1/2] CI on push to main only --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 868b76e2..f47cb56c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,6 +2,8 @@ name: test on: push: + branches: + - main pull_request: jobs: From 1aae303856683a9e6bc347b46cbc51fd56ea3d3b Mon Sep 17 00:00:00 2001 From: Sean Carroll Date: Mon, 13 Jun 2022 00:35:23 +0200 Subject: [PATCH 2/2] Use bundler cache in CI --- .github/workflows/test.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f47cb56c..d305b27c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,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 @@ -56,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 @@ -63,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 @@ -107,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 @@ -123,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