Skip to content

Commit

Permalink
Add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
fatkodima committed Mar 5, 2024
1 parent c0eef3e commit ac833b1
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Test
on: [push, pull_request]

jobs:
# Run the linter first for rapid feedback if some trivial stylistic issues
# slipped through the cracks.
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler-cache: true
- run: bundle exec rubocop

test:
needs: lint
runs-on: ubuntu-latest
strategy:
matrix:
include:
- ruby-version: 2.7
gemfile: activerecord_70.gemfile
- ruby-version: 2.7
gemfile: activerecord_71.gemfile

# Test against latest versions just in case.
- ruby-version: 3.3
gemfile: activerecord_head.gemfile
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Run the test suite
run: bundle exec rake test
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ GEM
sqlite3 (1.7.2)
mini_portile2 (~> 2.8.0)
sqlite3 (1.7.2-x86_64-darwin)
sqlite3 (1.7.2-x86_64-linux)
timeout (0.4.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
Expand All @@ -73,6 +74,7 @@ GEM
PLATFORMS
ruby
x86_64-darwin-21
x86_64-linux

DEPENDENCIES
activerecord
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Where a regular limit / offset pagination would jump in results if a record on a

To learn more about cursor pagination, check out the _"How does it work?"_ section below.

[![Build Status](https://github.com/fatkodima/activerecord_cursor_paginate/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/fatkodima/activerecord_cursor_paginate/actions/workflows/test.yml)

## Requirements

- Ruby 2.7+
Expand Down

0 comments on commit ac833b1

Please sign in to comment.