Skip to content

Commit

Permalink
Merge pull request #105 from SUSE/update_github_actions
Browse files Browse the repository at this point in the history
Update GitHub actions and default rubocop configuration
  • Loading branch information
vpereira authored Jul 25, 2022
2 parents cfb6ddc + fa5e433 commit 2d7be17
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 2 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/build-gem.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Check if the gem exists on rubygems.org

on: [pull_request]

jobs:
build-gem:
runs-on: ubuntu-latest
continue-on-error: true

strategy:
matrix:
ruby-version: ['2.5', '2.7']

steps:
- uses: actions/checkout@v2
- name: Set up Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
- name: Check if gem exists
run: |
GEM_VERSION=$(ruby -e "require 'scc/codestyle'; print Scc::Codestyle::VERSION" -I lib)
# if we install the gem, then the $GEM_VERSION already exist on rubygems.org
# therefore error
gem install -q --silent scc-codestyle -v $GEM_VERSION && (touch failed-install && exit 0) || exit 0
test -f failed-install && (echo "bump the gem version!" && exit 1)
4 changes: 4 additions & 0 deletions .github/workflows/gem-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: scc-codestyle
on:
push:
branches: [ master ]
paths:
- default.yml
- scc-codestyle.gemspec
- lib/scc/codestyle/version.rb

jobs:
build:
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Rubocop

on: [pull_request]

jobs:
rubocop:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.6


- name: Run rubocop
run: |
bundle install
bundle exec rubocop
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
inherit_from:
- .rubocop_todo.yml
- default.yml



Naming/FileName:
inherit_mode:
merge:
Expand Down
14 changes: 14 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2022-07-22 12:23:32 UTC using RuboCop version 1.31.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 1
# Configuration parameters: Include.
# Include: **/*.gemspec
Gemspec/RequiredRubyVersion:
Exclude:
- 'scc-codestyle.gemspec'
1 change: 0 additions & 1 deletion default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,6 @@ Lint/UnreachableLoop: # (new in 0.89)
Enabled: true
Lint/UselessMethodDefinition: # (new in 0.90)
Enabled: true
AllowComments: true
Lint/UselessTimes: # (new in 0.91)
Enabled: true
Style/AccessorGrouping: # (new in 0.87)
Expand Down
2 changes: 1 addition & 1 deletion lib/scc/codestyle/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Scc
module Codestyle
VERSION = '0.6.1'.freeze
VERSION = '0.6.2'.freeze
end
end

0 comments on commit 2d7be17

Please sign in to comment.