Skip to content

Commit

Permalink
Migrate to GitHub Actions for CI (#3444)
Browse files Browse the repository at this point in the history
I decided to move our continuous integration to GitHub Actions.
  • Loading branch information
parndt committed Sep 2, 2020
1 parent d0cebec commit 1b73e0b
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 53 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CI

on: [push]

jobs:
test:
strategy:
matrix:
database: [ mysql, postgresql ]
extension: [ core, dragonfly, images, pages, resources ]
ruby: [ "2.7.x", "2.6.x" ]
fail-fast: false
max-parallel: 10
runs-on: ubuntu-latest

env:
BUNDLE_JOBS: 4
BUNDLE_PATH: vendor/bundle
CI: true
DB: ${{ matrix.database }}
MYSQL_PASSWORD: root
PGHOST: localhost
PGUSER: postgres
RAILS_ENV: test

name: ${{ matrix.extension }} ${{ matrix.ruby }} ${{ matrix.database }}
steps:
- uses: actions/[email protected]
with:
version: ${{ matrix.ruby }}
- uses: actions/checkout@v2
- run: sudo apt-get update && sudo apt-get install libpq-dev libmysqlclient-dev libsqlite3-dev -y
- run: sudo systemctl start mysql.service
- id: cache-bundler
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ matrix.ruby }}-gem-${{ matrix.database }}-${{ hashFiles('Gemfile') }}
- run: bundle install --without development --path vendor/bundle
- run: bin/rake refinery:testing:dummy_app
env:
PGPORT: ${{ job.services.postgres.ports[5432] }}

- run: bin/rspec ${{ matrix.extension }}/spec
env:
PGPORT: ${{ job.services.postgres.ports[5432] }}
RETRY_COUNT: 3

services:
postgres:
image: postgres:11.5
ports: ["5432:5432"]
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
40 changes: 0 additions & 40 deletions .travis.yml

This file was deleted.

17 changes: 9 additions & 8 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,38 @@ path "./" do
gem "refinerycms-resources"
end

gem 'bootsnap', require: false
gem 'listen'

gem 'activejob'

# Add support for refinerycms-acts-as-indexed
gem 'refinerycms-acts-as-indexed', ['~> 3.0', '>= 3.0.0']

# Add the default visual editor, for now.
gem 'refinerycms-wymeditor', ['~> 2.2', '>= 2.2.0']

# Database Configuration
unless ENV['TRAVIS']
unless ENV['CI']
gem 'activerecord-jdbcsqlite3-adapter', '>= 1.3.0.rc1', platform: :jruby
gem 'sqlite3', platform: :ruby
end

if !ENV['TRAVIS'] || ENV['DB'] == 'mysql'
if !ENV['CI'] || ENV['DB'] == 'mysql'
group :mysql do
gem 'activerecord-jdbcmysql-adapter', '>= 1.3.0.rc1', platform: :jruby
gem 'mysql2', '~> 0.4', :platform => :ruby
end
end

if !ENV['TRAVIS'] || ENV['DB'] == 'postgresql'
if !ENV['CI'] || ENV['DB'] == 'postgresql'
group :postgres, :postgresql do
gem 'activerecord-jdbcpostgresql-adapter', '>= 1.3.0.rc1', platform: :jruby
gem 'pg', '~> 0.21', platform: :ruby
end
end

group :development, :test do
gem 'activejob'
gem 'bootsnap', require: false
gem 'listen', '~> 3.0'
end

group :test do
gem 'refinerycms-testing', path: './testing'
gem 'generator_spec', '~> 0.9.3'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ login: &login
reconnect: false
pool: 5
username: root
password:
password: <%%= ENV['MYSQL_PASSWORD'] %>
#socket: /tmp/mysql.sock
<% elsif /postgresql/ === @database %>
adapter: postgresql
Expand All @@ -31,4 +31,4 @@ test:

production:
<<: *login
database: dummy_prod
database: dummy_prod
6 changes: 3 additions & 3 deletions core/spec/lib/generators/refinery/cms/cms_generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ module Refinery
end
end
directory "config" do
file "database.yml.mysql"
file "database.yml.postgresql"
file "database.yml.sqlite3"
file "database.mysql.yml"
file "database.postgresql.yml"
file "database.sqlite3.yml"
end
}
end
Expand Down

0 comments on commit 1b73e0b

Please sign in to comment.