Skip to content

Commit

Permalink
Merge pull request #6 from google/workflows
Browse files Browse the repository at this point in the history
Run RSpec tests for push and pull request events
  • Loading branch information
kaankivilcim authored Jan 10, 2024
2 parents b1eeb47 + 0a1fd2c commit 0053c51
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/rspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Run RSpec tests
on: [push, pull_request]
jobs:
run-rspec-tests:
strategy:
matrix:
version: ['7.0', '6.0']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true # Runs 'bundle install' and caches installed gems automatically
- name: Remove the default activerecord Gem
run: bundle remove activerecord
- name: Add a specific version of the activerecord Gem
run: bundle add activerecord --version "~> ${{ matrix.version }}" --group "development,test"
- name: Run tests
run: ./run_tests.sh
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ignore files related to RSpec tests
foobar.db*
8 changes: 8 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Gemfile
source "https://rubygems.org"

group :development, :test do
gem "activerecord"
gem "rspec"
gem "sqlite3"
end
3 changes: 3 additions & 0 deletions run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Run RSpec tests
bundle exec rspec --exclude-pattern "spec/load_spec.rb" --format documentation
bundle exec rspec spec/load_spec.rb --format documentation
1 change: 1 addition & 0 deletions spec/safequerymanager_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

require 'safe_active_record/load'
require 'safe_active_record/safe_query_manager'

describe SafeActiveRecord::SafeQueryManager do
Expand Down

0 comments on commit 0053c51

Please sign in to comment.