forked from zerocracy/judges-action
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
46 lines (38 loc) · 1.08 KB
/
Rakefile
File metadata and controls
46 lines (38 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# frozen_string_literal: true
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 Zerocracy
# SPDX-License-Identifier: MIT
require 'os'
require 'qbash'
require 'rubygems'
require 'rake'
require 'rake/clean'
require 'shellwords'
ENV['RACK_RUN'] = 'true'
task default: %i[clean test judges rubocop picks]
require 'rake/testtask'
desc 'Run all unit tests'
Rake::TestTask.new(:test) do |test|
test.libs << 'lib' << 'test'
test.pattern = ['test/**/test_*.rb', 'test/**/test-*.rb']
test.warning = true
test.verbose = false
end
desc 'Run them via Ruby, one by one'
task :picks do
next if OS.windows?
%w[test lib].each do |d|
Dir["#{d}/**/*.rb"].each do |f|
qbash("bundle exec ruby #{Shellwords.escape(f)} -- --no-cov", stdout: $stdout)
end
end
end
desc 'Test all judges'
task :judges do
live = ARGV.include?('--live') ? '' : '--disable live'
sh "judges --verbose test #{live} --no-log --lib lib --option=action_version=0.0.0 judges"
end
require 'rubocop/rake_task'
desc 'Run RuboCop on all directories'
RuboCop::RakeTask.new(:rubocop) do |task|
task.fail_on_error = true
end