From 89349f1ac75ff84d8f5d68487830054dce54a8ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Justin=20L=C3=A9ger?= Date: Thu, 13 Aug 2020 11:47:44 -0400 Subject: [PATCH 1/4] Add rubocop github action step --- .github/workflows/rubocop_lint.yml | 27 +++++++++++++++++++ ...cop-https---relaxed-ruby-style-rubocop-yml | 25 ++--------------- .rubocop.yml | 3 +++ 3 files changed, 32 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/rubocop_lint.yml diff --git a/.github/workflows/rubocop_lint.yml b/.github/workflows/rubocop_lint.yml new file mode 100644 index 0000000..40c6093 --- /dev/null +++ b/.github/workflows/rubocop_lint.yml @@ -0,0 +1,27 @@ +name: Lint ๐Ÿ’Ž + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby 2.6 is + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6.x + - uses: actions/cache@v1 + with: + path: vendor/bundle + key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} + restore-keys: | + ${{ runner.os }}-gems- + - name: Run Rubocop linter + run: | + gem install bundler + bundle config path vendor/bundle + bundle install --jobs 4 --retry 3 + bundle exec rubocop diff --git a/.rubocop-https---relaxed-ruby-style-rubocop-yml b/.rubocop-https---relaxed-ruby-style-rubocop-yml index 6916280..10f1193 100644 --- a/.rubocop-https---relaxed-ruby-style-rubocop-yml +++ b/.rubocop-https---relaxed-ruby-style-rubocop-yml @@ -1,5 +1,5 @@ # Relaxed.Ruby.Style -## Version 2.4 +## Version 2.5 Style/Alias: Enabled: false @@ -145,30 +145,9 @@ Lint/AssignmentInCondition: Enabled: false StyleGuide: https://relaxed.ruby.style/#lintassignmentincondition -Metrics/AbcSize: - Enabled: false - -Metrics/BlockNesting: - Enabled: false - -Metrics/ClassLength: - Enabled: false - -Metrics/ModuleLength: - Enabled: false - -Metrics/CyclomaticComplexity: - Enabled: false - Layout/LineLength: Enabled: false -Metrics/MethodLength: - Enabled: false - -Metrics/ParameterLists: - Enabled: false - -Metrics/PerceivedComplexity: +Metrics: Enabled: false diff --git a/.rubocop.yml b/.rubocop.yml index 0d0cd82..3cde3fe 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -13,3 +13,6 @@ Style/ClassVars: AllCops: TargetRubyVersion: 2.6 + +Gemspec/RequiredRubyVersion: + Enabled: false From a26603d56c52b8554028969aea49683f76265b9c Mon Sep 17 00:00:00 2001 From: Justin Leger Date: Thu, 13 Aug 2020 12:12:38 -0400 Subject: [PATCH 2/4] Add test github action --- .github/workflows/run_tests.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/run_tests.yml diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml new file mode 100644 index 0000000..93fb4ba --- /dev/null +++ b/.github/workflows/run_tests.yml @@ -0,0 +1,27 @@ +name: Tests ๐Ÿงช + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby 2.6 is + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6.x + - uses: actions/cache@v1 + with: + path: vendor/bundle + key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} + restore-keys: | + ${{ runner.os }}-gems- + - name: Run test suite + run: | + gem install bundler + bundle config path vendor/bundle + bundle install --jobs 4 --retry 3 + bundle exec rake test From 3e9a451dcebf897ea7fb937d35f508316cda98c1 Mon Sep 17 00:00:00 2001 From: Justin Leger Date: Thu, 13 Aug 2020 12:17:35 -0400 Subject: [PATCH 3/4] Add badges to readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fb7b5d9..72d6bc7 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Slackify [![Build Status](https://travis-ci.org/jusleg/slackify.svg?branch=master)](https://travis-ci.org/jusleg/slackify) [![Gem Version](https://badge.fury.io/rb/slackify.svg)](https://badge.fury.io/rb/slackify) ![Gem downloads](https://img.shields.io/gem/dt/slackify) +# Slackify [![Tests ๐Ÿงช](https://github.com/jusleg/slackify/workflows/Tests%20%F0%9F%A7%AA/badge.svg)](https://github.com/jusleg/slackify/actions?query=workflow%3A%22Tests+%F0%9F%A7%AA%22) [![Lint ๐Ÿ’Ž](https://github.com/jusleg/slackify/workflows/Lint%20%F0%9F%92%8E/badge.svg)](https://github.com/jusleg/slackify/actions?query=workflow%3A%22Lint+%F0%9F%92%8E%22) [![Gem Version](https://badge.fury.io/rb/slackify.svg)](https://badge.fury.io/rb/slackify) ![Gem downloads](https://img.shields.io/gem/dt/slackify) Slackify is a gem that allows to build slackbots on Rails using the [Event API](https://api.slack.com/events-api) from Slack. From 048ad332f84544f7c742b4abfdad7ff02bd52b10 Mon Sep 17 00:00:00 2001 From: Justin Leger Date: Thu, 13 Aug 2020 12:18:12 -0400 Subject: [PATCH 4/4] Remove travis config --- .travis.yml | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ca34b7b..0000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: ruby -rvm: - - 2.5.1 - -before_install: - - "gem update --system" - - "gem install bundler" - -install: - - bundle install - -jobs: - include: - - stage: "Tests + Linting" - name: "Linting" - script: bundle exec rubocop - - script: bundle exec rake - name: "Tests"