Skip to content

Commit 3859dba

Browse files
committed
Merge branch 'v202'
* v202: (46 commits) Fix railsadminteam#2890 Test against Rails 6.1 Fix Coveralls flag name Make Coveralls functional under GitHub Actions Add rspec-retry to mitigate random spec failure CI against ActiveRecord adapters properly Migrate to GitHub Actions, thanks Travis-CI! Use raw_connection to retrieve encoding for mysql2 client CI: Update to JRuby 9.2.13.0 Hide association input for deeply nested fields Remove non working link refactoring the field_wrapper_for add the spec of field_wrapper_for fix the indent of hidden field in create and edit actions CI: Update to JRuby 9.2.11.0 Version 2.0.2 Fix XSS vulnerability in nested forms Fix Rubocop offense Remove not using of yell_for_non_accessible_fields Add 'Reset Filters' translation to I18n ...
2 parents fbe759f + 4ae890e commit 3859dba

69 files changed

Lines changed: 10482 additions & 3537 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test.yml

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
name: Test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
rspec:
7+
name: RSpec
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
ruby: [ 2.6, 2.7, jruby ]
12+
gemfile: [ gemfiles/rails_6.0.gemfile ]
13+
orm: [ active_record ]
14+
adapter: [ sqlite3 ]
15+
include:
16+
- ruby: 2.2
17+
gemfile: gemfiles/rails_5.0.gemfile
18+
orm: active_record
19+
adapter: sqlite3
20+
- ruby: 2.3
21+
gemfile: gemfiles/rails_5.1.gemfile
22+
orm: active_record
23+
adapter: sqlite3
24+
- ruby: 2.4
25+
gemfile: gemfiles/rails_5.2.gemfile
26+
orm: active_record
27+
adapter: sqlite3
28+
- ruby: 2.5
29+
gemfile: gemfiles/rails_5.2.gemfile
30+
orm: active_record
31+
adapter: sqlite3
32+
- ruby: 2.7
33+
gemfile: gemfiles/rails_6.1.gemfile
34+
orm: active_record
35+
adapter: sqlite3
36+
- ruby: 2.7
37+
gemfile: gemfiles/rails_6.1.gemfile
38+
orm: active_record
39+
adapter: mysql2
40+
- ruby: 2.7
41+
gemfile: gemfiles/rails_6.1.gemfile
42+
orm: active_record
43+
adapter: postgresql
44+
- ruby: 2.6
45+
gemfile: gemfiles/rails_5.2.gemfile
46+
orm: mongoid
47+
adapter: sqlite3
48+
- ruby: 2.7
49+
gemfile: gemfiles/rails_6.0.gemfile
50+
orm: mongoid
51+
adapter: sqlite3
52+
- ruby: jruby
53+
gemfile: gemfiles/rails_6.0.gemfile
54+
orm: mongoid
55+
adapter: sqlite3
56+
runs-on: ubuntu-16.04
57+
services:
58+
mysql:
59+
image: mysql:8.0
60+
ports:
61+
- 3306:3306
62+
env:
63+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
64+
postgres:
65+
image: postgres:11
66+
ports:
67+
- 5432:5432
68+
env:
69+
POSTGRES_USER: postgres
70+
POSTGRES_PASSWORD: postgres
71+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
72+
mongo:
73+
image: mongo:4.4
74+
ports:
75+
- 27017:27017
76+
env:
77+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
78+
CI_ORM: ${{ matrix.orm }}
79+
JRUBY_OPTS: --debug
80+
steps:
81+
- uses: actions/checkout@v2
82+
- name: Set up Ruby
83+
uses: ruby/setup-ruby@v1
84+
with:
85+
ruby-version: ${{ matrix.ruby }}
86+
- name: Cache gems
87+
uses: actions/cache@v2
88+
with:
89+
path: vendor/bundle
90+
key: ${{ runner.os }}-gems-${{ matrix.ruby }}-${{ hashFiles('Gemfile', 'gemfiles/*.gemfile') }}
91+
restore-keys: |
92+
${{ runner.os }}-gems-${{ matrix.ruby }}-
93+
- name: Install dependencies
94+
run: bundle install --without development --jobs=3 --retry=3 --path=vendor/bundle
95+
- name: Setup application
96+
env:
97+
BUNDLE_GEMFILE: ../../${{ matrix.gemfile }}
98+
CI_DB_ADAPTER: ${{ matrix.adapter }}
99+
RAILS_ENV: test
100+
run: |
101+
cd spec/dummy_app
102+
bundle exec rake rails_admin:prepare_ci_env db:create db:migrate
103+
cd ../../
104+
- name: Run tests
105+
run: bundle exec rake spec
106+
- name: Coveralls Parallel
107+
uses: coverallsapp/github-action@master
108+
continue-on-error: true
109+
with:
110+
github-token: ${{ secrets.github_token }}
111+
flag-name: run-${{ matrix.ruby }}-${{ matrix.gemfile }}-${{ matrix.orm }}-${{ matrix.adapter }}
112+
parallel: true
113+
114+
coveralls:
115+
name: Coveralls
116+
needs: rspec
117+
runs-on: ubuntu-16.04
118+
steps:
119+
- name: Coveralls Finished
120+
uses: coverallsapp/github-action@master
121+
with:
122+
github-token: ${{ secrets.github_token }}
123+
parallel-finished: true
124+
125+
rubocop:
126+
name: RuboCop
127+
runs-on: ubuntu-16.04
128+
steps:
129+
- uses: actions/checkout@v2
130+
- name: Set up Ruby
131+
uses: ruby/setup-ruby@v1
132+
with:
133+
ruby-version: 2.7
134+
- name: Cache gems
135+
uses: actions/cache@v2
136+
with:
137+
path: vendor/bundle
138+
key: ${{ runner.os }}-gems-${{ matrix.ruby }}-${{ hashFiles('Gemfile') }}
139+
restore-keys: |
140+
${{ runner.os }}-gems-${{ matrix.ruby }}-
141+
- name: Install dependencies
142+
run: bundle install --without development --jobs=3 --retry=3 --path=vendor/bundle
143+
- name: Run check
144+
run: bundle exec rake rubocop

.rubocop.yml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,21 @@ inherit_from: .rubocop_todo.yml
22

33
AllCops:
44
Exclude:
5+
- 'gemfiles/*'
56
- 'spec/dummy_app/bin/**/*'
67
- 'spec/dummy_app/db/schema.rb'
78
- 'spec/dummy_app/tmp/**/*'
89
- 'vendor/bundle/**/*'
910

11+
Layout/AccessModifierIndentation:
12+
EnforcedStyle: outdent
13+
14+
Layout/DotPosition:
15+
EnforcedStyle: trailing
16+
17+
Layout/SpaceInsideHashLiteralBraces:
18+
EnforcedStyle: no_space
19+
1020
Metrics/AbcSize:
1121
Max: 69.98 # TODO: Lower to 15
1222

@@ -38,8 +48,9 @@ Metrics/ParameterLists:
3848
Metrics/PerceivedComplexity:
3949
Max: 14 # TODO: Lower to 7
4050

41-
Style/AccessModifierIndentation:
42-
EnforcedStyle: outdent
51+
Naming/FileName:
52+
Exclude:
53+
- 'lib/rails_admin/bootstrap-sass.rb'
4354

4455
Style/Alias:
4556
Enabled: false
@@ -54,9 +65,6 @@ Style/CollectionMethods:
5465
Style/Documentation:
5566
Enabled: false
5667

57-
Style/DotPosition:
58-
EnforcedStyle: trailing
59-
6068
Style/DoubleNegation:
6169
Enabled: false
6270

@@ -66,10 +74,6 @@ Style/EachWithObject:
6674
Style/Encoding:
6775
Enabled: false
6876

69-
Style/FileName:
70-
Exclude:
71-
- 'lib/rails_admin/bootstrap-sass.rb'
72-
7377
Style/FrozenStringLiteralComment:
7478
Enabled: false
7579

@@ -79,11 +83,11 @@ Style/Lambda:
7983
Style/RaiseArgs:
8084
EnforcedStyle: compact
8185

82-
Style/SpaceInsideHashLiteralBraces:
83-
EnforcedStyle: no_space
84-
8586
Style/TrailingCommaInArguments:
8687
EnforcedStyleForMultiline: 'comma'
8788

88-
Style/TrailingCommaInLiteral:
89+
Style/TrailingCommaInArrayLiteral:
90+
EnforcedStyleForMultiline: 'comma'
91+
92+
Style/TrailingCommaInHashLiteral:
8993
EnforcedStyleForMultiline: 'comma'

0 commit comments

Comments
 (0)