Skip to content

Commit

Permalink
upload codeclimate.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
olegphenomenon committed Nov 16, 2022
1 parent 3c1c1a1 commit 231ae3f
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 10 deletions.
31 changes: 31 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: "2"
prepare:
fetch:
- "https://raw.githubusercontent.com/internetee/style-guide/master/.rubocop-ruby.yml"
- url: "https://raw.githubusercontent.com/internetee/style-guide/master/.rubocop-rails.yml"
path: ".rubocop.yml"
plugins:
brakeman:
enabled: true
bundler-audit:
enabled: true
duplication:
enabled: true
config:
languages:
- ruby
- javascript
eslint:
enabled: true
rubocop:
enabled: true
channel: rubocop-1-12-1
exclude_patterns:
- "bin/"
- "config/"
- "db/"
- "lib/"
- "vendor/"
- "test/"
- "karma.conf.js"
- "app/packs/src/semantic/"
14 changes: 8 additions & 6 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
curl -LSs 'https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64' >./cc-test-reporter;
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
- name: Run Tests
env:
PG_DATABASE: postgres
Expand All @@ -64,28 +65,29 @@ jobs:
DISABLE_SPRING: 1
run: |
cp config/database_ci.yml config/database.yml
cp config/application.yml.sample config/application.yml
bundle exec rake db:create
bundle exec rake db:migrate
bundle exec rake db:schema:load
bundle exec rake db:seed
bundle exec rspec spec
- name: Dependabot
if: ${{ github.event.label.name == 'dependencies' }}
run: bundle exec rails assets:precompile
# - name: Dependabot
# if: ${{ github.event.label.name == 'dependencies' }}
# run: bundle exec rails assets:precompile

- name: Save coverage
run: ./cc-test-reporter format-coverage --output coverage/codeclimate.${{ matrix.ruby }}.json

- uses: actions/upload-artifact@v2.3.1
- uses: actions/upload-artifact@v3.1.1
with:
name: coverage-${{ matrix.ruby }}
path: coverage/codeclimate.${{ matrix.ruby }}.json

upload_coverage:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-18.04 ]
ruby: [ '3.0.3' ]
runs-on: ubuntu-18.04

Expand All @@ -110,4 +112,4 @@ jobs:
- name: Aggregate & upload results to Code Climate
run: |
./cc-test-reporter sum-coverage coverage/codeclimate.*.json
./cc-test-reporter upload-coverage -r
./cc-test-reporter upload-coverage -r ${{ secrets.CC_TEST_REPORTER_ID }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
/yarn-error.log
yarn-debug.log*
.yarn-integrity
/coverage/*
/coverage/

# Ignore application configuration
/config/application.yml
3 changes: 0 additions & 3 deletions codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,9 @@ checks:
config:
threshold: 25
exclude_patterns:
- "app/models/version/"
- "bin/"
- "config/"
- "db/"
- "lib/core_monkey_patches/"
- "lib/gem_monkey_patches/"
- "lib/tasks/*"
- "spec/"
- "vendor/"
Expand Down

0 comments on commit 231ae3f

Please sign in to comment.