From ddac765fb045974d4dbb8c96c89f62191d9de850 Mon Sep 17 00:00:00 2001 From: Luca Guidi Date: Fri, 15 Jan 2021 21:17:42 +0100 Subject: [PATCH] GitHub Actions (#1090) --- .drone.yml | 349 -------------------------- .github/workflows/ci.yml | 43 ++++ .travis.yml | 24 -- LICENSE.md | 2 +- README.md | 4 +- spec/integration/cli/db/apply_spec.rb | 5 +- 6 files changed, 49 insertions(+), 378 deletions(-) delete mode 100644 .drone.yml create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 50d2837b..00000000 --- a/.drone.yml +++ /dev/null @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..40238fe6 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index afe27da6..00000000 --- a/.travis.yml +++ /dev/null @@ -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 diff --git a/LICENSE.md b/LICENSE.md index 2e763592..ebdf22bb 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -Copyright © 2014-2019 Luca Guidi +Copyright © 2014-2021 Luca Guidi MIT License diff --git a/README.md b/README.md index a0bbd282..5a7e713e 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/spec/integration/cli/db/apply_spec.rb b/spec/integration/cli/db/apply_spec.rb index 4205b16c..e241fc9c 100644 --- a/spec/integration/cli/db/apply_spec.rb +++ b/spec/integration/cli/db/apply_spec.rb @@ -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