Commit f963f761 authored by Robert Speicher's avatar Robert Speicher

Merge branch '31463-group-all-linters' into 'master'

Resolve "Consider grouping all static analysis jobs into a single one"

Closes #31463

See merge request !10946
parents 623eb34f 9b3f728c
No related merge requests found
...@@ -253,38 +253,32 @@ spinach mysql 9 10: *spinach-knapsack-mysql ...@@ -253,38 +253,32 @@ spinach mysql 9 10: *spinach-knapsack-mysql
SETUP_DB: "false" SETUP_DB: "false"
USE_BUNDLE_INSTALL: "true" USE_BUNDLE_INSTALL: "true"
.exec: &exec .rake-exec: &rake-exec
<<: *ruby-static-analysis <<: *ruby-static-analysis
<<: *dedicated-runner <<: *dedicated-runner
<<: *except-docs <<: *except-docs
stage: test stage: test
script: script:
- bundle exec $CI_JOB_NAME - bundle exec rake $CI_JOB_NAME
rubocop: static-analysis:
<<: *ruby-static-analysis <<: *ruby-static-analysis
<<: *dedicated-runner <<: *dedicated-runner
<<: *except-docs <<: *except-docs
stage: test stage: test
script: script:
- bundle exec "rubocop --require rubocop-rspec" - scripts/static-analysis
rake haml_lint: *exec downtime_check:
rake scss_lint: *exec <<: *rake-exec
rake config_lint: *exec
rake brakeman: *exec
rake flay: *exec
license_finder: *exec
rake downtime_check:
<<: *exec
except: except:
- master - master
- tags - tags
- /^[\d-]+-stable(-ee)?$/ - /^[\d-]+-stable(-ee)?$/
- /^docs\/*/ - /^docs\/*/
rake ee_compat_check: ee_compat_check:
<<: *exec <<: *rake-exec
only: only:
- branches@gitlab-org/gitlab-ce - branches@gitlab-org/gitlab-ce
except: except:
...@@ -309,12 +303,12 @@ rake ee_compat_check: ...@@ -309,12 +303,12 @@ rake ee_compat_check:
script: script:
- bundle exec rake db:migrate:reset - bundle exec rake db:migrate:reset
rake pg db:migrate:reset: db:migrate:reset pg:
<<: *db-migrate-reset <<: *db-migrate-reset
<<: *use-pg <<: *use-pg
<<: *except-docs <<: *except-docs
rake mysql db:migrate:reset: db:migrate:reset mysql:
<<: *db-migrate-reset <<: *db-migrate-reset
<<: *use-mysql <<: *use-mysql
<<: *except-docs <<: *except-docs
...@@ -326,12 +320,12 @@ rake mysql db:migrate:reset: ...@@ -326,12 +320,12 @@ rake mysql db:migrate:reset:
- bundle exec rake db:rollback STEP=120 - bundle exec rake db:rollback STEP=120
- bundle exec rake db:migrate - bundle exec rake db:migrate
rake pg db:rollback: db:rollback pg:
<<: *db-rollback <<: *db-rollback
<<: *use-pg <<: *use-pg
<<: *except-docs <<: *except-docs
rake mysql db:rollback: db:rollback mysql:
<<: *db-rollback <<: *db-rollback
<<: *use-mysql <<: *use-mysql
<<: *except-docs <<: *except-docs
...@@ -353,17 +347,17 @@ rake mysql db:rollback: ...@@ -353,17 +347,17 @@ rake mysql db:rollback:
paths: paths:
- log/development.log - log/development.log
rake pg db:seed_fu: db:seed_fu pg:
<<: *db-seed_fu <<: *db-seed_fu
<<: *use-pg <<: *use-pg
<<: *except-docs <<: *except-docs
rake mysql db:seed_fu: db:seed_fu mysql:
<<: *db-seed_fu <<: *db-seed_fu
<<: *use-mysql <<: *use-mysql
<<: *except-docs <<: *except-docs
rake gitlab:assets:compile: gitlab:assets:compile:
stage: test stage: test
<<: *dedicated-runner <<: *dedicated-runner
<<: *except-docs <<: *except-docs
...@@ -383,7 +377,7 @@ rake gitlab:assets:compile: ...@@ -383,7 +377,7 @@ rake gitlab:assets:compile:
paths: paths:
- webpack-report/ - webpack-report/
rake karma: karma:
cache: cache:
paths: paths:
- vendor/ruby - vendor/ruby
...@@ -402,16 +396,6 @@ rake karma: ...@@ -402,16 +396,6 @@ rake karma:
paths: paths:
- coverage-javascript/ - coverage-javascript/
docs:check:apilint:
image: "phusion/baseimage"
stage: test
<<: *dedicated-runner
cache: {}
dependencies: []
before_script: []
script:
- scripts/lint-doc.sh
docs:check:links: docs:check:links:
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:nanoc-bootstrap-ruby-2.4-alpine" image: "registry.gitlab.com/gitlab-org/gitlab-build-images:nanoc-bootstrap-ruby-2.4-alpine"
stage: test stage: test
...@@ -459,11 +443,11 @@ bundler:audit: ...@@ -459,11 +443,11 @@ bundler:audit:
- . scripts/prepare_build.sh - . scripts/prepare_build.sh
- bundle exec rake db:migrate - bundle exec rake db:migrate
migration pg paths: migration path pg:
<<: *migration-paths <<: *migration-paths
<<: *use-pg <<: *use-pg
migration mysql paths: migration path mysql:
<<: *migration-paths <<: *migration-paths
<<: *use-mysql <<: *use-mysql
...@@ -485,14 +469,6 @@ coverage: ...@@ -485,14 +469,6 @@ coverage:
- coverage/index.html - coverage/index.html
- coverage/assets/ - coverage/assets/
lint:javascript:
<<: *dedicated-runner
<<: *except-docs
stage: test
before_script: []
script:
- yarn run eslint
lint:javascript:report: lint:javascript:report:
<<: *dedicated-runner <<: *dedicated-runner
<<: *except-docs <<: *except-docs
...@@ -548,8 +524,8 @@ pages: ...@@ -548,8 +524,8 @@ pages:
<<: *dedicated-runner <<: *dedicated-runner
dependencies: dependencies:
- coverage - coverage
- rake karma - karma
- rake gitlab:assets:compile - gitlab:assets:compile
- lint:javascript:report - lint:javascript:report
script: script:
- mv public/ .public/ - mv public/ .public/
......
...@@ -21,4 +21,3 @@ fi ...@@ -21,4 +21,3 @@ fi
echo "✔ Linting passed" echo "✔ Linting passed"
exit 0 exit 0
#!/usr/bin/env ruby
require ::File.expand_path('../lib/gitlab/popen', __dir__)
tasks = [
%w[bundle exec rake config_lint],
%w[bundle exec rake flay],
%w[bundle exec rake haml_lint],
%w[bundle exec rake scss_lint],
%w[bundle exec rake brakeman],
%w[bundle exec license_finder],
%w[scripts/lint-doc.sh],
%w[yarn run eslint],
%w[bundle exec rubocop --require rubocop-rspec]
]
failed_tasks = tasks.reduce({}) do |failures, task|
output, status = Gitlab::Popen.popen(task)
puts "Running: #{task.join(' ')}"
puts output
failures[task.join(' ')] = output unless status.zero?
failures
end
if failed_tasks.empty?
puts 'All static analyses passed successfully.'
else
puts "\n===================================================\n\n"
puts "Some static analyses failed:"
failed_tasks.each do |failed_task, output|
puts "\n**** #{failed_task} failed with the following error:\n\n"
puts output
end
exit 1
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment