diff --git a/.codeclimate.yml b/.codeclimate.yml new file mode 100644 index 00000000..8f6ae9de --- /dev/null +++ b/.codeclimate.yml @@ -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/" diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 0b009a7c..ac902d7f 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -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 @@ -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 @@ -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 }} diff --git a/.gitignore b/.gitignore index 6ab70a94..0e559a10 100644 --- a/.gitignore +++ b/.gitignore @@ -38,7 +38,7 @@ /yarn-error.log yarn-debug.log* .yarn-integrity -/coverage/* +/coverage/ # Ignore application configuration /config/application.yml diff --git a/codeclimate.yml b/codeclimate.yml index b76c37a7..dedf3cee 100644 --- a/codeclimate.yml +++ b/codeclimate.yml @@ -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/"