-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #194 from nikz/master
Adds GitHub Actions CI + fixes for Ruby 3.1
- Loading branch information
Showing
7 changed files
with
111 additions
and
4 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,79 @@ | ||
name: Tests | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
name: Test on Ruby ${{ matrix.ruby-version }} / Active Record ${{ matrix.rails }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ruby-version: [ '2.7', '3.0', '3.1'] | ||
rails: ['5_0', '5_1', '5_2', '6_0', '6_1', '7_0'] | ||
exclude: | ||
# exclude unsupported ruby versions: https://github.com/rails/rails/issues/40938 | ||
- ruby-version: '3.0' | ||
rails: '5_0' | ||
- ruby-version: '3.0' | ||
rails: '5_1' | ||
- ruby-version: '3.0' | ||
rails: '5_2' | ||
- ruby-version: '3.1' | ||
rails: '5_0' | ||
- ruby-version: '3.1' | ||
rails: '5_1' | ||
- ruby-version: '3.1' | ||
rails: '5_2' | ||
|
||
env: | ||
TESTING_RAILS_VERSION: ${{ matrix.rails }} | ||
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/activerecord_${{ matrix.rails }}.gemfile | ||
|
||
services: | ||
postgres: | ||
image: postgres | ||
env: | ||
POSTGRES_USER: crypt_keeper | ||
POSTGRES_PASSWORD: crypt_keeper | ||
POSTGRES_DB: crypt_keeper_providers | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
mysql: | ||
image: mysql:5.7 | ||
env: | ||
MYSQL_DATABASE: crypt_keeper_providers | ||
MYSQL_USER: crypt_keeper | ||
MYSQL_PASSWORD: crypt_keeper | ||
MYSQL_ROOT_PASSWORD: rootpassword | ||
ports: | ||
- 33306:3306 | ||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup System | ||
run: sudo apt-get install libsqlite3-dev | ||
|
||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby-version }} | ||
bundler-cache: true | ||
|
||
- name: Copy database config | ||
run: | | ||
cp spec/github_actions.database.yml spec/database.yml | ||
- name: Enable pgcrypto extension | ||
run: | | ||
PGPASSWORD=crypt_keeper psql crypt_keeper_providers -h localhost -p 5432 -U crypt_keeper -tc "CREATE EXTENSION IF NOT EXISTS pgcrypto;" | ||
- name: Run tests | ||
run: 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
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
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
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
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
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,25 @@ | ||
postgres: | ||
adapter: postgresql | ||
encoding: utf8 | ||
reconnect: false | ||
host: localhost | ||
database: crypt_keeper_providers | ||
pool: 5 | ||
username: crypt_keeper | ||
password: crypt_keeper | ||
min_messages: WARNING | ||
mysql: | ||
adapter: mysql2 | ||
encoding: utf8 | ||
reconnect: false | ||
database: crypt_keeper_providers | ||
pool: 5 | ||
host: 127.0.0.1 | ||
port: 33306 | ||
username: crypt_keeper | ||
password: crypt_keeper | ||
sqlite: | ||
adapter: sqlite3 | ||
encoding: utf8 | ||
reconnect: false | ||
database: ':memory:' |