Skip to content

Commit

Permalink
Upgrade workflow (#43)
Browse files Browse the repository at this point in the history
* Test and lint against node 16 too
* Upgrading Rubocop and Rspec workflows with latest version of Ruby and Rails
* Using string for ruby versions
* Removing TargetRubyVersion in rubocop
* Updating node-version to latest LTS
* Removing Ruby 3.1 in workflows
* remove ruby 3.0 from ruby specs workflow
* add ruby 2.6 into ruby specs workflow
* specify ruby 2.6 to use Gemfile rails 5.2.x to 6.1x
* add ruby 3.0 into ruby specs workflow
* support ruby 2.6 in workflow
* exclude ruby 3.0 from using rails 5.2

Co-authored-by: Guillaume Briday <[email protected]>
  • Loading branch information
frullah and guillaumebriday authored Feb 1, 2022
1 parent 976c2e8 commit a349a9a
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 54 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/jest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@ jobs:
node-version: ${{ matrix.node }}
cache: yarn

- name: Install yarn maybe
run: which yarn || npm install -g yarn

- name: Install dependencies
run: yarn --frozen-lockfile
run: yarn --frozen-lockfile --non-interactive --prefer-offline

- name: Jest Specs
run: yarn test
10 changes: 3 additions & 7 deletions .github/workflows/js-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ name: JS lint
on: [push, pull_request]

jobs:
js-lint:
lint:
name: JS Lint

strategy:
matrix:
os: [ubuntu-latest]
node: [14]
node: [12.x, 14.x, 16.x]

runs-on: ${{ matrix.os }}

Expand All @@ -21,11 +20,8 @@ jobs:
node-version: ${{ matrix.node }}
cache: yarn

- name: Install yarn maybe
run: which yarn || npm install -g yarn

- name: Install dependencies
run: yarn --frozen-lockfile
run: yarn --frozen-lockfile --non-interactive --prefer-offline

- name: Lint
run: yarn lint
23 changes: 3 additions & 20 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,17 @@ jobs:
rubocop:
name: Rubocop
runs-on: ${{ matrix.os }}
env:
BUNDLE_JOBS: 4
BUNDLE_RETRY: 3
strategy:
matrix:
os: [ubuntu-latest]
ruby: [
2.7
]
ruby: ['2.7', '3.0']

steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: /home/runner/bundle
key: bundle-use-ruby-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
bundle-use-ruby-gems-
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- name: Bundle install
run: |
gem install bundler -v 2.1.4
bundle config path /home/runner/bundle
bundle install
- name: Ruby linter
- name: Ruby rubocop
run: bundle exec rubocop
31 changes: 12 additions & 19 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,36 @@ jobs:
test:
name: Ruby specs
runs-on: ${{ matrix.os }}
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' || matrix.experimental }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
ruby:
- 2.7
- "3.0"
ruby: ['2.6', '2.7', '3.0']
gemfile:
- gemfiles/Gemfile-rails.5.2.x
- gemfiles/Gemfile-rails.6.0.x
- gemfiles/Gemfile-rails.6.1.x
- gemfiles/Gemfile-rails.7.0.x
- gemfiles/Gemfile-rails-edge
exclude:
- ruby: 2.5
gemfile: gemfiles/Gemfile-rails.6.1.x
- ruby: "3.0"
gemfile: gemfiles/Gemfile-rails.5.2.x
experimental: [false]
include:
- ruby: 2.7
- ruby: 2.6
os: ubuntu-latest
gemfile: gemfiles/Gemfile-rails-edge
experimental: true
- ruby: "3.0"
gemfile: gemfiles/Gemfile-rails.7.0.x
- ruby: 2.6
os: ubuntu-latest
gemfile: gemfiles/Gemfile-rails-edge
experimental: true
- ruby: 3.0
os: ubuntu-latest
gemfile: gemfiles/Gemfile-rails.5.2.x

env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}

steps:
- uses: actions/checkout@v2

- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # Run "bundle install", and cache the result automatically.
bundler-cache: true

- name: Ruby specs
run: bundle exec rake
run: bundle exec rake test
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.7.0
16
1 change: 0 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
require: rubocop-performance
AllCops:
TargetRubyVersion: 2.7
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
# to ignore them, so only the ones explicitly set in this file are enabled.
DisabledByDefault: true
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
shakapacker (6.0.0)
shakapacker (6.1.0.beta.0)
activesupport (>= 5.2)
rack-proxy (>= 0.6.1)
railties (>= 5.2)
Expand Down
12 changes: 12 additions & 0 deletions gemfiles/Gemfile-rails.7.0.x
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
source "https://rubygems.org"

git_source(:github) { |repo| "https://github.com/#{repo}.git" }

gemspec path: "../"

gem "rails", '~>7.0.0'
gem "arel", github: "rails/arel"
gem "rake", ">= 11.1"
gem "rack-proxy", require: false
gem "minitest", "~> 5.0"
gem "byebug"
2 changes: 1 addition & 1 deletion webpacker.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Gem::Specification.new do |s|
"source_code_uri" => "https://github.com/shakacode/shakapacker/tree/v#{npm_version}",
}

s.required_ruby_version = ">= 2.7.0"
s.required_ruby_version = ">= 2.6.0"

s.add_dependency "activesupport", ">= 5.2"
s.add_dependency "railties", ">= 5.2"
Expand Down

0 comments on commit a349a9a

Please sign in to comment.