-
-
Notifications
You must be signed in to change notification settings - Fork 638
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
155dd5b
commit 8a1e071
Showing
2 changed files
with
69 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Test & lint | ||
on: [push] | ||
|
||
env: | ||
RAILS_ENV: test | ||
PGHOST: localhost | ||
PGUSER: postgres | ||
|
||
jobs: | ||
tests: | ||
name: Test & lint | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ruby: ['2.3.5', '2.4.2', '2.5.1', '2.6.3', '2.7.0'] | ||
gemfile: ['gemfiles/activerecord_4.2.0.gemfile', 'gemfiles/activerecord_5.0.2.gemfile', 'gemfiles/activerecord_5.1.0.gemfile', 'gemfiles/activerecord_5.2.2.gemfile', 'gemfiles/activerecord_6.0.0.gemfile'] | ||
exclude: | ||
- gemfile: 'gemfiles/activerecord_4.2.0.gemfile' | ||
ruby: '2.7.0' | ||
- gemfile: 'gemfiles/activerecord_6.0.0.gemfile' | ||
ruby: '2.4.2' | ||
- gemfile: 'gemfiles/activerecord_6.0.0.gemfile' | ||
ruby: '2.3.5' | ||
|
||
services: | ||
postgres: | ||
image: postgres | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_DB: cancan_postgresql_spec | ||
POSTGRES_PASSWORD: postgres | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: ["5432:5432"] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: '20' | ||
|
||
- name: Setup Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
|
||
- name: Install bundler | ||
run: gem install bundler | ||
|
||
- name: Install gems | ||
run: BUNDLE_GEMFILE=${{ matrix.gemfile }} bundle install | ||
|
||
- name: Run linter | ||
run: BUNDLE_GEMFILE=${{ matrix.gemfile }} bundle exec rubocop | ||
|
||
- name: Run tests on sqlite | ||
run: DB=sqlite BUNDLE_GEMFILE=${{ matrix.gemfile }} bundle exec rake | ||
|
||
- name: Run tests on postgres | ||
run: DB=postgres BUNDLE_GEMFILE=${{ matrix.gemfile }} bundle exec rake |
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