Improve #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: RLS | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
specs: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
gemfile: [ rails_7_0, rails_7_1 ] | |
ruby: [ 2.7, 3.1, 3.2 ] | |
env: | |
DATABASE_URL: postgres://postgres:postgres@localhost:5432 | |
RAILS_ENV: test | |
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile | |
services: | |
postgres: | |
image: postgres:12 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
ports: ['5432:5432'] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
- name: Setup database | |
working-directory: ./spec/dummy | |
run: | | |
bundle exec rake db:create | |
bundle exec rake rls:create_role | |
bundle exec rake db:prepare | |
- name: Run tests | |
run: bundle exec rspec --backtrace |