forked from ruby-grape/grape-swagger-entity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate from Travis to GHA (ruby-grape#61)
* Add GHA * Get building * Remove Ruby 2.6 * Remove Ruby 2.7 too * Add lint job and remove travis config * Fix rubocop config and autocorrect * Fix tests * Update rubucop_todo.yml * Use newer ruby for rubocop * More rubocop fixes * Add danger workflow * Update badges and rename workflow from ruby to test * Update CHANGELOG
- Loading branch information
Showing
16 changed files
with
200 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: danger | ||
on: pull_request | ||
|
||
jobs: | ||
danger: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 100 | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 3.2 | ||
bundler-cache: true | ||
rubygems: latest | ||
- name: Run Danger | ||
run: | | ||
# the token is public, has public_repo scope and belongs to the grape-bot user owned by @dblock, this is ok | ||
TOKEN=$(echo -n Z2hwX2lYb0dPNXNyejYzOFJyaTV3QUxUdkNiS1dtblFwZTFuRXpmMwo= | base64 --decode) | ||
DANGER_GITHUB_API_TOKEN=$TOKEN bundle exec danger --verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: test | ||
|
||
on: [push, pull_request] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
lint: | ||
name: RuboCop | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 3.2 | ||
bundler-cache: true | ||
rubygems: latest | ||
|
||
- name: Run RuboCop | ||
run: bundle exec rubocop | ||
|
||
test: | ||
env: | ||
GRAPE_ENTITY: 0.8.0 | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ruby-version: ['3.0', '3.1', '3.2'] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby-version }} | ||
bundler-cache: true | ||
- name: Run tests | ||
run: bundle exec rake spec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,5 @@ | |
/spec/reports/ | ||
/tmp/ | ||
.ruby-gemset | ||
.ruby-version | ||
.ruby-version | ||
/.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,106 @@ | ||
# This configuration was generated by | ||
# `rubocop --auto-gen-config` | ||
# on 2020-06-29 22:12:50 UTC using RuboCop version 0.86.0. | ||
# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 5000` | ||
# on 2023-07-06 17:02:48 UTC using RuboCop version 1.42.0. | ||
# 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. | ||
# Configuration parameters: Severity, Include. | ||
# Include: **/*.gemspec | ||
Gemspec/RequiredRubyVersion: | ||
Exclude: | ||
- 'grape-swagger-entity.gemspec' | ||
|
||
# Offense count: 3 | ||
# Configuration parameters: AllowedMethods. | ||
# AllowedMethods: enums | ||
Lint/ConstantDefinitionInBlock: | ||
Exclude: | ||
- 'spec/grape-swagger/entities/response_model_spec.rb' | ||
- 'spec/support/shared_contexts/inheritance_api.rb' | ||
- 'spec/support/shared_contexts/this_api.rb' | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: AllowComments, AllowEmptyLambdas. | ||
Lint/EmptyBlock: | ||
Exclude: | ||
- 'spec/grape-swagger/entity/attribute_parser_spec.rb' | ||
|
||
# Offense count: 1 | ||
# This cop supports unsafe autocorrection (--autocorrect-all). | ||
# Configuration parameters: AllowedMethods. | ||
# AllowedMethods: instance_of?, kind_of?, is_a?, eql?, respond_to?, equal? | ||
Lint/RedundantSafeNavigation: | ||
Exclude: | ||
- 'lib/grape-swagger/entity/attribute_parser.rb' | ||
|
||
# Offense count: 4 | ||
# Configuration parameters: IgnoredMethods. | ||
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, CountRepeatedAttributes, Max. | ||
Metrics/AbcSize: | ||
Max: 30 | ||
Exclude: | ||
- 'lib/grape-swagger/entity/attribute_parser.rb' | ||
- 'lib/grape-swagger/entity/parser.rb' | ||
|
||
# Offense count: 13 | ||
# Configuration parameters: CountComments, Max, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods. | ||
# AllowedMethods: refine | ||
Metrics/BlockLength: | ||
Exclude: | ||
- '**/*.gemspec' | ||
- 'spec/grape-swagger/entities/response_model_spec.rb' | ||
- 'spec/grape-swagger/entity/attribute_parser_spec.rb' | ||
- 'spec/grape-swagger/entity/parser_spec.rb' | ||
- 'spec/support/shared_contexts/this_api.rb' | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: CountComments. | ||
# Configuration parameters: CountComments, Max, CountAsOne. | ||
Metrics/ClassLength: | ||
Max: 111 | ||
Exclude: | ||
- 'lib/grape-swagger/entity/parser.rb' | ||
|
||
# Offense count: 2 | ||
# Configuration parameters: IgnoredMethods. | ||
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, Max. | ||
Metrics/CyclomaticComplexity: | ||
Max: 11 | ||
Exclude: | ||
- 'lib/grape-swagger/entity/attribute_parser.rb' | ||
- 'lib/grape-swagger/entity/parser.rb' | ||
|
||
# Offense count: 5 | ||
# Configuration parameters: CountComments, ExcludedMethods. | ||
# Configuration parameters: CountComments, Max, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods. | ||
Metrics/MethodLength: | ||
Max: 25 | ||
Exclude: | ||
- 'lib/grape-swagger/entity/attribute_parser.rb' | ||
- 'lib/grape-swagger/entity/parser.rb' | ||
|
||
# Offense count: 2 | ||
# Configuration parameters: IgnoredMethods. | ||
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, Max. | ||
Metrics/PerceivedComplexity: | ||
Max: 12 | ||
Exclude: | ||
- 'lib/grape-swagger/entity/attribute_parser.rb' | ||
- 'lib/grape-swagger/entity/parser.rb' | ||
|
||
# Offense count: 2 | ||
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns. | ||
# SupportedStyles: snake_case, normalcase, non_integer | ||
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339 | ||
Naming/VariableNumber: | ||
Exclude: | ||
- 'spec/grape-swagger/entities/response_model_spec.rb' | ||
|
||
# Offense count: 4 | ||
# Configuration parameters: AllowedConstants. | ||
Style/Documentation: | ||
Exclude: | ||
- 'spec/**/*' | ||
- 'test/**/*' | ||
- 'lib/grape-swagger/entity.rb' | ||
- 'lib/grape-swagger/entity/attribute_parser.rb' | ||
- 'lib/grape-swagger/entity/parser.rb' | ||
|
||
# Offense count: 4 | ||
Style/OpenStructUse: | ||
Exclude: | ||
- 'spec/grape-swagger/entities/response_model_spec.rb' | ||
- 'spec/support/shared_contexts/this_api.rb' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.