Skip to content

Commit

Permalink
Update workflow to run with Ruby versions mayor to 3.0 (#36)
Browse files Browse the repository at this point in the history
* Update workflow to run with Ruby versions mayor to 3.0
  • Loading branch information
blacksam07 authored Oct 9, 2024
1 parent dee7aa9 commit c64ffad
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 14 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
push:
branches: ["master", "main"]

concurrency:
group: ${{ github.ref }}-CI
cancel-in-progress: true

jobs:
linters:
runs-on: ubuntu-latest
Expand All @@ -18,7 +22,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: 3.0
bundler-cache: true

- name: Run linters
Expand All @@ -30,11 +34,11 @@ jobs:
fail-fast: false
matrix:
include:
- ruby: ruby:2.5
- ruby: ruby:2.6
- ruby: ruby:2.7
- ruby: ruby:3.0
coverage: true
- ruby: ruby:3.1
- ruby: ruby:3.2
- ruby: ruby:3.3
name: test/ruby ${{ matrix.ruby }}
steps:
- name: Checkout repository
Expand Down
2 changes: 0 additions & 2 deletions .reek.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ detectors:
enabled: true
exclude: []
max_allowed_nesting: 2
ignore_iterators: []
NilCheck:
enabled: false
exclude: []
Expand Down Expand Up @@ -127,4 +126,3 @@ detectors:
exclude_paths:
- config
- lib/generators/apple_auth/apple_auth_controller/templates

8 changes: 5 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
AllCops:
TargetRubyVersion: 2.5
TargetRubyVersion: 3.0
SuggestExtensions: false
NewCops: disable
Exclude:
- lib/generators/apple_auth/apple_auth_controller/templates/**

Expand All @@ -22,10 +24,10 @@ Metrics/BlockLength:
CountComments: false
Max: 25
Exclude:
- '*.gemspec'
- "*.gemspec"
- config/**/*
- spec/**/*
ExcludedMethods:
AllowedMethods:
- class_methods

Metrics/BlockNesting:
Expand Down
6 changes: 3 additions & 3 deletions apple_auth.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'byebug', '~> 11.1'
spec.add_development_dependency 'railties', '~> 6.0'
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'reek', '~> 5.6'
spec.add_development_dependency 'reek', '~> 6.0'
spec.add_development_dependency 'rspec', '~> 3.9'
spec.add_development_dependency 'rubocop', '~> 0.80'
spec.add_development_dependency 'parser', '~> 2.7.1.1'
spec.add_development_dependency 'rubocop', '~> 1.66'
spec.add_development_dependency 'parser', '~> 3.3.0'
spec.add_development_dependency 'simplecov', '~> 0.17.1'
spec.add_development_dependency 'webmock', '~> 3.8'
end
2 changes: 1 addition & 1 deletion lib/apple_auth/token.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def request_header

def gen_private_key
key = AppleAuth.config.apple_private_key
key = OpenSSL::PKey::EC.new(key) unless key.class == OpenSSL::PKey::EC
key = OpenSSL::PKey::EC.new(key) unless key.instance_of?(OpenSSL::PKey::EC)
key
end

Expand Down
4 changes: 3 additions & 1 deletion spec/token_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require 'ostruct'

RSpec.describe AppleAuth::Token do
subject(:token_service) { described_class.new(code) }

Expand All @@ -9,7 +11,7 @@

before do
AppleAuth.config.apple_client_id = 'client_id'
AppleAuth.config.apple_private_key = OpenSSL::PKey::EC.new('prime256v1').generate_key!
AppleAuth.config.apple_private_key = OpenSSL::PKey::EC.generate('prime256v1')
AppleAuth.config.apple_key_id = 'apple_kid'
AppleAuth.config.apple_team_id = 'team_id'
AppleAuth.config.redirect_uri = 'www.example.com'
Expand Down

0 comments on commit c64ffad

Please sign in to comment.