GitHub Actions (#1090)

This commit is contained in:
Luca Guidi 2021-01-15 21:17:42 +01:00 committed by GitHub
parent 80fd6ad379
commit ddac765fb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 49 additions and 378 deletions

View File

@ -1,349 +0,0 @@
kind: pipeline
name: ruby-2-6
group: build
steps:
- name: install
image: hanami/ruby-2.6-full
docker:
stdin_open: true
tty: true
environment:
CI: true
volumes:
- name: bundle
path: /usr/local/bundle
commands:
- ruby -v
- gem install bundler
- bundle install --jobs=3 --retry=3
- name: unit
image: hanami/ruby-2.6-full
docker:
stdin_open: true
tty: true
environment:
CI: true
volumes:
- name: bundle
path: /usr/local/bundle
commands:
- COVERAGE=true bundle exec rake spec:unit
- name: isolation
image: hanami/ruby-2.6-full
docker:
stdin_open: true
tty: true
environment:
CI: true
volumes:
- name: bundle
# path: /drone/src/vendor/cache
path: /usr/local/bundle
commands:
- ./script/test isolation
- name: integration
image: hanami/ruby-2.6-full
docker:
stdin_open: true
tty: true
environment:
CI: true
volumes:
- name: bundle
# path: /drone/src/vendor/cache
path: /usr/local/bundle
commands:
- ./script/test integration
- name: quality
image: hanami/ruby-2.6-full
docker:
stdin_open: true
tty: true
environment:
CI: true
CODECOV_TOKEN:
from_secret: codecov
volumes:
- name: bundle
# path: /drone/src/vendor/cache
path: /usr/local/bundle
commands:
- CI=true bundle exec rake codecov:upload
volumes:
- name: bundle
temp: {}
---
kind: pipeline
name: ruby-2-5
group: build
steps:
- name: install
image: hanami/ruby-2.5-full
docker:
stdin_open: true
tty: true
environment:
CI: true
volumes:
- name: bundle
path: /usr/local/bundle
commands:
- ruby -v
- gem install bundler
- bundle install --jobs=3 --retry=3
- name: unit
image: hanami/ruby-2.5-full
docker:
stdin_open: true
tty: true
environment:
CI: true
volumes:
- name: bundle
path: /usr/local/bundle
commands:
- COVERAGE=true bundle exec rake spec:unit
- name: isolation
image: hanami/ruby-2.5-full
docker:
stdin_open: true
tty: true
environment:
CI: true
volumes:
- name: bundle
# path: /drone/src/vendor/cache
path: /usr/local/bundle
commands:
- ./script/test isolation
- name: integration
image: hanami/ruby-2.5-full
docker:
stdin_open: true
tty: true
environment:
CI: true
volumes:
- name: bundle
# path: /drone/src/vendor/cache
path: /usr/local/bundle
commands:
- ./script/test integration
- name: quality
image: hanami/ruby-2.5-full
docker:
stdin_open: true
tty: true
environment:
CI: true
CODECOV_TOKEN:
from_secret: codecov
volumes:
- name: bundle
# path: /drone/src/vendor/cache
path: /usr/local/bundle
commands:
- CI=true bundle exec rake codecov:upload
volumes:
- name: bundle
temp: {}
---
kind: pipeline
name: ruby-2-4
group: build
steps:
- name: install
image: hanami/ruby-2.4-full
docker:
stdin_open: true
tty: true
environment:
CI: true
volumes:
- name: bundle
path: /usr/local/bundle
commands:
- ruby -v
- gem install bundler
- bundle install --jobs=3 --retry=3
- name: unit
image: hanami/ruby-2.4-full
docker:
stdin_open: true
tty: true
environment:
CI: true
volumes:
- name: bundle
path: /usr/local/bundle
commands:
- COVERAGE=true bundle exec rake spec:unit
- name: isolation
image: hanami/ruby-2.4-full
docker:
stdin_open: true
tty: true
environment:
CI: true
volumes:
- name: bundle
# path: /drone/src/vendor/cache
path: /usr/local/bundle
commands:
- ./script/test isolation
- name: integration
image: hanami/ruby-2.4-full
docker:
stdin_open: true
tty: true
environment:
CI: true
volumes:
- name: bundle
# path: /drone/src/vendor/cache
path: /usr/local/bundle
commands:
- ./script/test integration
- name: quality
image: hanami/ruby-2.4-full
docker:
stdin_open: true
tty: true
environment:
CI: true
CODECOV_TOKEN:
from_secret: codecov
volumes:
- name: bundle
# path: /drone/src/vendor/cache
path: /usr/local/bundle
commands:
- CI=true bundle exec rake codecov:upload
volumes:
- name: bundle
temp: {}
---
kind: pipeline
name: ruby-2-3
group: build
steps:
- name: install
image: hanami/ruby-2.3-full
docker:
stdin_open: true
tty: true
environment:
CI: true
volumes:
- name: bundle
path: /usr/local/bundle
commands:
- ruby -v
- gem install bundler
- bundle install --jobs=3 --retry=3
- name: unit
image: hanami/ruby-2.3-full
docker:
stdin_open: true
tty: true
environment:
CI: true
volumes:
- name: bundle
path: /usr/local/bundle
commands:
- COVERAGE=true bundle exec rake spec:unit
- name: isolation
image: hanami/ruby-2.3-full
docker:
stdin_open: true
tty: true
environment:
CI: true
volumes:
- name: bundle
# path: /drone/src/vendor/cache
path: /usr/local/bundle
commands:
- ./script/test isolation
- name: integration
image: hanami/ruby-2.3-full
docker:
stdin_open: true
tty: true
environment:
CI: true
volumes:
- name: bundle
# path: /drone/src/vendor/cache
path: /usr/local/bundle
commands:
- ./script/test integration
- name: quality
image: hanami/ruby-2.3-full
docker:
stdin_open: true
tty: true
environment:
CI: true
CODECOV_TOKEN:
from_secret: codecov
volumes:
- name: bundle
# path: /drone/src/vendor/cache
path: /usr/local/bundle
commands:
- CI=true bundle exec rake codecov:upload
volumes:
- name: bundle
temp: {}
---
kind: pipeline
name: slack
group: build
clone:
disable: true
depends_on:
- ruby-2-3
steps:
- name: slack
image: plugins/slack
settings:
link_names: true
webhook:
from_secret: slack
channel: dev
when:
event:
- push

43
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,43 @@
name: ci
"on":
push:
paths:
- ".github/workflows/ci.yml"
- "lib/**"
- "*.gemspec"
- "spec/**"
- "Rakefile"
- "Gemfile"
- ".rubocop.yml"
pull_request:
branches:
- master
create:
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby:
- "2.7"
- "2.6"
- "2.5"
- "2.4"
steps:
- uses: actions/checkout@v1
- name: Install package dependencies
run: "[ -e $APT_DEPS ] || sudo apt-get install -y --no-install-recommends $APT_DEPS"
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{matrix.ruby}}
- name: Install latest bundler
run: |
gem install bundler --no-document
- name: Bundle install
run: bundle install --jobs 4 --retry 3
- name: Run all tests
run: script/ci

View File

@ -1,24 +0,0 @@
language: ruby
sudo: false
cache: bundler
install: true
before_install:
- mkdir $PWD/vendor/phantomjs && tar -xjf $PWD/vendor/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C $PWD/vendor/phantomjs --strip-components=1
- export PATH=$PWD/vendor/phantomjs/bin:$PATH
- phantomjs --version
- gem update --system # Required to install rainbow 2.2.1 https://github.com/sickill/rainbow/issues/44#issuecomment-274412027
script:
- './script/ci'
rvm:
- 2.3.8
- 2.4.5
- 2.5.3
- 2.6.0
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/fde2367248d53de4fe70
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: never # options: [always|never|change] default: always

View File

@ -1,4 +1,4 @@
Copyright © 2014-2019 Luca Guidi
Copyright © 2014-2021 Luca Guidi
MIT License

View File

@ -25,7 +25,7 @@ These components are designed to be used independently or together in a Hanami a
## Status
[![Gem Version](https://badge.fury.io/rb/hanami.svg)](https://badge.fury.io/rb/hanami)
[![TravisCI](https://travis-ci.org/hanami/hanami.svg?branch=master)](https://travis-ci.org/hanami/hanami)
[![CI](https://github.com/hanami/hanami/workflows/ci/badge.svg?branch=master)](https://github.com/hanami/hanami/actions?query=workflow%3Aci+branch%3Amaster)
[![Test Coverage](https://codecov.io/gh/hanami/hanami/branch/master/graph/badge.svg)](https://codecov.io/gh/hanami/hanami)
[![Depfu](https://badges.depfu.com/badges/ba000e0f69e6ef1c44cd3038caaa1841/overview.svg)](https://depfu.com/github/hanami/hanami?project=Bundler)
[![Inline Docs](http://inch-ci.org/github/hanami/hanami.svg)](http://inch-ci.org/github/hanami/hanami)
@ -136,4 +136,4 @@ Released under MIT License.
This project was formerly known as Lotus (`lotusrb`).
Copyright © 2014-2019 Luca Guidi.
Copyright © 2014-2021 Luca Guidi.

View File

@ -40,8 +40,9 @@ SQL
expect(schema).to have_file_content <<-SQL
CREATE TABLE `schema_migrations` (`filename` varchar(255) NOT NULL PRIMARY KEY);
CREATE TABLE `users` (`id` integer NOT NULL PRIMARY KEY AUTOINCREMENT, `name` varchar(255), `age` integer);
INSERT INTO "schema_migrations" VALUES('#{versions.first}_create_users.rb');
INSERT INTO "schema_migrations" VALUES('#{versions.last}_add_age_to_users.rb');
CREATE TABLE sqlite_sequence(name,seq);
INSERT INTO schema_migrations VALUES('#{versions.first}_create_users.rb');
INSERT INTO schema_migrations VALUES('#{versions.last}_add_age_to_users.rb');
SQL
expect(migrations.children).to be_empty