|
@@ -3,13 +3,10 @@
|
|
|
stage: lint
|
|
|
extends:
|
|
|
- .job_rules_default
|
|
|
- before_script:
|
|
|
- - !reference [.scripts, source_rvm]
|
|
|
|
|
|
.template_lint_rails: &template_lint_rails
|
|
|
- stage: lint
|
|
|
extends:
|
|
|
- - .job_rules_default
|
|
|
+ - .template_lint
|
|
|
- .services_postgresql
|
|
|
before_script:
|
|
|
- !reference [.scripts, source_rvm]
|
|
@@ -21,16 +18,16 @@
|
|
|
'lint: shellcheck':
|
|
|
<<: *template_lint
|
|
|
image: koalaman/shellcheck-alpine:stable
|
|
|
- before_script:
|
|
|
- - echo "Disable default before_script."
|
|
|
+ cache: []
|
|
|
+ before_script: []
|
|
|
script:
|
|
|
- shellcheck -S warning $(find . -name "*.sh" -o -name "functions" | egrep -v "/vendor|node_modules/")
|
|
|
- shellcheck -S error script/init.d/*
|
|
|
- after_script:
|
|
|
- - echo "Disable default before_script."
|
|
|
+ after_script: []
|
|
|
|
|
|
-'lint: i18n, rails & security':
|
|
|
+'lint: i18n & rails':
|
|
|
<<: *template_lint_rails
|
|
|
+ cache: !reference [.cache, read_only_full]
|
|
|
artifacts:
|
|
|
expire_in: 1 week
|
|
|
paths:
|
|
@@ -44,16 +41,28 @@
|
|
|
- bundle exec rails generate translation_catalog --check
|
|
|
- echo "Brakeman security check..."
|
|
|
- bundle exec brakeman -o /dev/stdout -o tmp/brakeman-report.html
|
|
|
+ - echo "Rails zeitwerk:check autoloader check..."
|
|
|
+ - bundle exec rails zeitwerk:check
|
|
|
+ - .gitlab/check_graphql_api_consistency.sh
|
|
|
+
|
|
|
+'lint: ruby & security':
|
|
|
+ <<: *template_lint
|
|
|
+ before_script:
|
|
|
+ - !reference [.scripts, source_rvm]
|
|
|
+ - !reference [.scripts, bundle_install]
|
|
|
+ script:
|
|
|
+ - echo "Rubocop check..."
|
|
|
+ - bundle exec .rubocop/validate_todos.rb
|
|
|
+ - bundle exec rubocop --parallel
|
|
|
- echo "bundler-audit security check..."
|
|
|
- gem install bundler-audit
|
|
|
- bundle-audit update
|
|
|
- bundle-audit --ignore CVE-2015-9284
|
|
|
- - echo "Rails zeitwerk:check autoloader check..."
|
|
|
- - bundle exec rails zeitwerk:check
|
|
|
- - .gitlab/check_graphql_api_consistency.sh
|
|
|
|
|
|
-'lint: ruby, js & css':
|
|
|
+'lint: js & css':
|
|
|
<<: *template_lint
|
|
|
+ cache: !reference [.cache, read_only_nodejs]
|
|
|
+ before_script: []
|
|
|
script:
|
|
|
- echo "Coffeelint check..."
|
|
|
- coffeelint --rules ./.coffeelint/rules/* app/
|
|
@@ -61,14 +70,10 @@
|
|
|
- !reference [.scripts, yarn_install]
|
|
|
- yarn lint:css
|
|
|
- echo "ESLint check..."
|
|
|
- - yarn install --cwd .storybook
|
|
|
+ - yarn storybook:install
|
|
|
- yarn lint
|
|
|
- - echo "Storybook build..."
|
|
|
+ - echo "Storybook test build..."
|
|
|
- yarn storybook:build
|
|
|
- - !reference [.scripts, bundle_install]
|
|
|
- - echo "Rubocop check..."
|
|
|
- - bundle exec .rubocop/validate_todos.rb
|
|
|
- - bundle exec rubocop --parallel
|
|
|
|
|
|
# Must be a separate job because it may fail and is only executed manually.
|
|
|
'lint: orphaned ruby gems':
|