Skip to content

Commit

Permalink
Move to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
tagliala committed Jun 29, 2021
1 parent 5671f80 commit d94c80b
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 76 deletions.
99 changes: 99 additions & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Ruby specs

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
name: Ruby specs
runs-on: ubuntu-latest

services:
db:
image: postgres:12
ports: ['5432:5432']
env:
POSTGRES_PASSWORD: postgres

options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
matrix:
ruby-version: ['2.6'] # ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0']
gemfile: ['rails_5.2'] # [ rails_5.0, rails_5.1, rails_5.2, rails_6.0 ]
experimental: [false]

include:
- ruby-version: 'head'
gemfile: rails_6.0
experimental: true

exclude:
- ruby-version: '2.3'
gemfile: rails_6.0
- ruby-version: '2.4'
gemfile: rails_6.0
- ruby-version: '2.6'
gemfile: rails_5.0
- ruby-version: '2.6'
gemfile: rails_5.1
- ruby-version: '2.7'
gemfile: rails_5.0
- ruby-version: '2.7'
gemfile: rails_5.1
- ruby-version: '2.7'
gemfile: rails_5.2
- ruby-version: '3.0'
gemfile: rails_5.0
- ruby-version: '3.0'
gemfile: rails_5.1
- ruby-version: '3.0'
gemfile: rails_5.2

env:
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
PGPASSWORD: postgres
TEST_CONFIG: ~/spec/config.github.yml

continue-on-error: ${{ matrix.experimental }}

steps:
- uses: actions/checkout@v2
- name: Set up Database
run: |
cat ~/spec/config.github.yml
env | grep TEST_CONFIG
psql -c "CREATE DATABASE chronomodel;" -U postgres -h localhost
psql -c "CREATE DATABASE chronomodel_railsapp;" -U postgres -h localhost
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Run specs
run: bundle exec rake

coverage:
needs: [ test ]
name: Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
node-version: '12'
- run: npm install -g yarn
- run: yarn install
- run: yarn build
- uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: dedfb7472ee410eec459bff3681d9a8fd8dd237e9bd7e8675a7c8eb7e253bba9
with:
coverageCommand: yarn coverage
73 changes: 0 additions & 73 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,8 @@ while using it in many important projects.
This software is Made in Italy :it: :smile:.


[build-status]: https://travis-ci.org/ifad/chronomodel
[build-status-badge]: https://travis-ci.org/ifad/chronomodel.svg
[build-status]: https://github.com/ifad/chronomodel/actions
[build-status-badge]: https://github.com/ifad/chronomodel/actions/workflows/ci.yml/badge.svg
[code-analysis]: https://codeclimate.com/github/ifad/chronomodel
[code-analysis-badge]: https://codeclimate.com/github/ifad/chronomodel.svg
[docs-analysis]: http://inch-ci.org/github/ifad/chronomodel
Expand Down
2 changes: 1 addition & 1 deletion spec/config.travis.yml → spec/config.github.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
hostname: localhost
username: postgres
password: ""
password: postgres
database: chronomodel
pool: 11

0 comments on commit d94c80b

Please sign in to comment.