diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 69920bc6..74b4b0f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,26 @@ name: CI on: [push] jobs: - build: + linters: + name: Linters + runs-on: ubuntu-latest + env: + RAILS_ENV: test + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - name: Setup Database + run: | + cp .github/test_db/config/database.yml config/database.yml + - name: Run Code Analysis + run: | + bundle exec rake code:analysis + tests: + name: Tests runs-on: ubuntu-latest services: @@ -19,7 +38,7 @@ jobs: --health-interval 10s --health-timeout 5s --health-retries 5 - + env: RAILS_ENV: test CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} @@ -35,7 +54,7 @@ jobs: run: | curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter chmod +x ./cc-test-reporter - ./cc-test-reporter before-build + ./cc-test-reporter before-build - name: Setup Database run: | cp .github/test_db/config/database.yml config/database.yml @@ -44,11 +63,6 @@ jobs: uses: rootstrap/check_untracked_changes@v1 with: path: "./db/schema.rb" - - name: I18n Health - run: bundle exec i18n-tasks health - - name: Run Code Analysis - run: | - bundle exec rake code:analysis - name: Run Tests run: | bundle exec rspec diff --git a/lib/tasks/code_analysis.rake b/lib/tasks/code_analysis.rake index 2cd62e2a..65b4e813 100644 --- a/lib/tasks/code_analysis.rake +++ b/lib/tasks/code_analysis.rake @@ -5,5 +5,6 @@ namespace :code do sh 'bundle exec rubocop .' sh 'bundle exec reek .' sh 'bundle exec rails_best_practices .' + sh 'bundle exec i18n-tasks health' end end