Skip to content

Commit

Permalink
Update rubocop.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Feb 2, 2024
1 parent 60ee1ba commit ec4a212
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 78 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Code style

on: [pull_request]
on: [ pull_request ]

jobs:
lint:
Expand All @@ -9,10 +9,7 @@ jobs:
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
version: 2.7.8
bundler-cache: true
- name: Checkout code
uses: actions/checkout@v3
- name: rubocop
run: bundle exec rubocop --parallel
run: bin/ontoportal run bundle exec rubocop --parallel
68 changes: 15 additions & 53 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,23 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
name: "Run local API tests CI"
name: RuboCop

on: [push, pull_request]

on:
push:
pull_request:
types: [ opened, reopened ]
env:
API_URL: http://localhost:9393
REMOTE_API_KEY: 8b5b7825-538d-40e0-9e9e-5ab9274a9aeb
REMOTE_API_URL: https://data.bioontology.org
BIOMIXER_URL: ${{ secrets.BIOMIXER_URL }}
FAIRNESS_URL: ${{ secrets.FAIRNESS_URL }}
ANNOTATOR_URL: ${{ secrets.ANNOTATOR_URL }}
DB_HOST: 127.0.0.1
jobs:
test:
rubocop:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
ports:
- "3306:3306"
env:
MYSQL_ROOT_PASSWORD: root
memcached:
image: memcached:1.6
ports:
- 11211:11211

steps:
- name: Checkout code
uses: actions/checkout@v3
# Add or replace dependency steps here
- name: Install Ruby and gems
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.8
bundler-cache: true
ruby-version: 2.7 # You can change this to your preferred Ruby version

- name: Run OntoPortal API
run: bin/run_api -k ${{ env.REMOTE_API_KEY }} -r agroportal -t development -s STY -u ${{ env.REMOTE_API_URL }}
- name: Install RuboCop
run:
gem install rubocop rubocop-rails

# Add or replace database setup steps here
- name: set up config file
run: cp config/database.yml.sample config/database.yml
- name: Set up database schema
run: RAILS_ENV=test bin/rails db:setup
- name: Set up yarn
run: yarn install
# Add or replace test runners here
- name: Run tests
run: COVERAGE=true RAILS_ENV=test bin/rails test -v
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Run RuboCop
run: rubocop --parallel --format github
13 changes: 12 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
AllCops:
NewCops: disable
Exclude:
- db/migrate/**/*
- db/schema.rb
Expand Down Expand Up @@ -61,4 +62,14 @@ Lint/UnusedMethodArgument:
AutoCorrect: false

Rails/HasAndBelongsToMany:
Enabled: false
Enabled: false

Layout/HeredocIndentation:
Enabled: false

Style/MissingRespondToMissing:
Enabled: false

Lint/MissingSuper:
Enabled: true

35 changes: 18 additions & 17 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ GEM
bigdecimal (3.1.6)
bindata (2.4.15)
bindex (0.8.1)
bootsnap (1.17.1)
bootsnap (1.18.3)
msgpack (~> 1.2)
bootstrap (4.2.1)
autoprefixer-rails (>= 9.1.0)
Expand Down Expand Up @@ -144,13 +144,14 @@ GEM
addressable
cube-ruby (0.0.3)
daemons (1.4.1)
dalli (3.2.6)
dalli (3.2.7)
base64
date (3.3.4)
debug (1.9.1)
irb (~> 1.10)
reline (>= 0.3.8)
deepl-rb (2.5.3)
diff-lcs (1.5.0)
diff-lcs (1.5.1)
docile (1.4.0)
domain_name (0.6.20240107)
ed25519 (1.3.0)
Expand All @@ -176,9 +177,8 @@ GEM
flamegraph (0.9.5)
globalid (1.2.1)
activesupport (>= 6.1)
graphql (2.2.5)
racc (~> 1.4)
graphql-client (0.18.0)
graphql (2.2.7)
graphql-client (0.19.0)
activesupport (>= 3.0)
graphql
haml (5.2.2)
Expand Down Expand Up @@ -313,7 +313,7 @@ GEM
net-protocol
net-ssh (7.2.1)
netrc (0.11.0)
newrelic_rpm (9.7.0)
newrelic_rpm (9.7.1)
nio4r (2.7.0)
nokogiri (1.15.5-x86_64-linux)
racc (~> 1.4)
Expand All @@ -330,21 +330,22 @@ GEM
hashie (>= 3.4.6)
rack (>= 2.2.3)
rack-protection
omniauth-github (2.0.0)
omniauth-github (2.0.1)
omniauth (~> 2.0)
omniauth-oauth2 (~> 1.7.1)
omniauth-google-oauth2 (0.8.0)
omniauth-oauth2 (~> 1.8)
omniauth-google-oauth2 (1.1.1)
jwt (>= 2.0)
omniauth (>= 1.1.1)
omniauth-oauth2 (>= 1.6)
omniauth-keycloak (1.5.1)
oauth2 (~> 2.0.6)
omniauth (~> 2.0)
omniauth-oauth2 (~> 1.8.0)
omniauth-keycloak (1.5.2)
faraday
json-jwt (> 1.13.0)
omniauth (>= 2.0)
omniauth-oauth2 (~> 1.7.1)
omniauth-oauth2 (1.7.3)
omniauth-oauth2 (>= 1.7, < 1.9)
omniauth-oauth2 (1.8.0)
oauth2 (>= 1.4, < 3)
omniauth (>= 1.9, < 3)
omniauth (~> 2.0)
omniauth-orcid (2.1.1)
omniauth-oauth2 (~> 1.3)
ruby_dig (~> 0.0.2)
Expand Down Expand Up @@ -437,7 +438,7 @@ GEM
rspec-mocks (3.12.6)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-rails (6.1.0)
rspec-rails (6.1.1)
actionpack (>= 6.1)
activesupport (>= 6.1)
railties (>= 6.1)
Expand Down

0 comments on commit ec4a212

Please sign in to comment.