From 0de5078d9d0db5a4fb011c14200c70e53120d0bb Mon Sep 17 00:00:00 2001 From: cn Date: Sat, 22 Aug 2020 12:20:23 +0200 Subject: [PATCH] ci: add Dockerfile linting --- .travis.yml | 3 +++ Rakefile | 23 +++++++++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4853706..da218f6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,5 +6,8 @@ rvm: - 2.6 - 2.5 +services: +- docker + script: - bundle exec rake travis diff --git a/Rakefile b/Rakefile index 9d06eec..00af25b 100644 --- a/Rakefile +++ b/Rakefile @@ -9,16 +9,23 @@ RSpec::Core::RakeTask.new(:spec) RuboCop::RakeTask.new Bundler::Audit::Task.new -desc 'Should be run by developer once to prepare initial solargraph usage (fill caches etc.)' -task :'solargraph:init' do - sh 'solargraph download-core' -end - desc 'Run experimental solargraph type checker' -task :'solargraph:tc' do +task :solargraph do sh 'solargraph typecheck' end -task default: [:rubocop, :spec, 'bundle:audit'] +namespace :solargraph do + desc 'Should be run by developer once to prepare initial solargraph usage (fill caches etc.)' + task :init do + sh 'solargraph download-core' + end +end -task travis: [:default, :'solargraph:init', :'solargraph:tc'] +desc 'Run hadolint for Dockerfile linting' +task :hadolint do + sh 'docker run --rm -i hadolint/hadolint:v1.18.0 hadolint --ignore DL3018 - < docker/Dockerfile' +end + +task default: [:rubocop, :spec, 'bundle:audit', :solargraph] + +task travis: ['solargraph:init', :default, :hadolint]