Skip to content

Commit

Permalink
add github actions config
Browse files Browse the repository at this point in the history
As travis stopped be free for all - lets move to github actions.

- Add ruby 3.0 to build matrix
- using DymnaDB ready made action installer did not work - could work with some more time for investigation. But it works the old way.
  • Loading branch information
aka47 committed Aug 20, 2021
1 parent 0e03746 commit 87aa82d
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 2 deletions.
108 changes: 108 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Tests

on:
push:
pull_request:

jobs:
build:
if: "contains(github.event.commits[0].message, '[ci skip]') == false"
continue-on-error: ${{ matrix.allow_failure || false }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-18.04
ruby:
- 3.0
- 2.7
- 2.6
- 2.5
- jruby-9.1.17.0
gemfile:
- norails
- rails_4.2
- rails_4.2_mongoid_5
- rails_5.0
- rails_5.1
- rails_5.2
- rails_6.1
exclude:
- ruby: 3.0
gemfile: rails_5.2
- ruby: 3.0
gemfile: rails_5.1
- ruby: 3.0
gemfile: rails_5.0
- ruby: 3.0
gemfile: rails_4.2
- ruby: 3.0
gemfile: rails_4.2_mongoid_5
- ruby: 2.7
gemfile: rails_5.2
- ruby: 2.7
gemfile: rails_4.2
- ruby: 2.7
gemfile: rails_4.2_mongoid_5
- ruby: 2.6
gemfile: rails_4.2_mongoid_5
- ruby: 2.6
gemfile: rails_4.2
- ruby: 2.5
gemfile: rails_4.2
- ruby: 2.5
gemfile: rails_4.2_mongoid_5
- ruby: jruby-9.1.17.0
gemfile: norails
- ruby: jruby-9.1.17.0
gemfile: rails_5.0
- ruby: jruby-9.1.17.0
gemfile: rails_5.1
- ruby: jruby-9.1.17.0
gemfile: rails_5.2
- ruby: jruby-9.1.17.0
gemfile: rails_6.1
redis-version: [6]
mongodb-version: ['4.4']
allow_failures:
- false
env:
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
ALLOW_FAILURES: "${{ matrix.allow_failures }}"
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
mkdir /tmp/dynamodb
wget -O - https://s3-ap-southeast-1.amazonaws.com/dynamodb-local-singapore/dynamodb_local_latest.tar.gz | tar xz --directory /tmp/dynamodb
java -Djava.library.path=/tmp/dynamodb/DynamoDBLocal_lib -jar /tmp/dynamodb/DynamoDBLocal.jar -inMemory -delayTransientStatuses -port 30180 &
mongod --version
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Setup project
run: bundle install
- name: Start Redis
uses: supercharge/redis-github-action@1.2.0
with:
redis-version: ${{ matrix.redis-version }}
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.6.0
with:
mongodb-version: ${{ matrix.mongodb-version }}
# - name: Setup DynamoDB Local
# uses: rrainn/dynamodb-action@v2.0.0
# with:
# port: 8000
# cors: '*'
- name: Run specs
run: bundle exec rspec spec
- name: Run test
run: bundle exec rake test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: false
4 changes: 2 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
end

if ENV['CI'] == 'true'
require 'codecov'
SimpleCov.formatter = SimpleCov::Formatter::Codecov
#require 'codecov'
#SimpleCov.formatter = SimpleCov::Formatter::Codecov
end

$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__)))
Expand Down

0 comments on commit 87aa82d

Please sign in to comment.