This repository was archived by the owner on May 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
67 lines (54 loc) · 1.25 KB
/
Rakefile
File metadata and controls
67 lines (54 loc) · 1.25 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# frozen_string_literal: true
require('bundler/gem_tasks')
require('rake/testtask')
require('rspec/core/rake_task')
begin
require('rubocop/rake_task')
rescue LoadError
puts('can not use rubocop in this environment')
else
RuboCop::RakeTask.new
end
task(default: [:test_behaviors])
task(test_behaviors: [:test, :spec])
desc('Simulate CI results in local machine as possible')
multitask(simulate_ci: [:test_behaviors, :rubocop])
Rake::TestTask.new(:test) do |tt|
tt.pattern = 'test/**/test_*.rb'
tt.warning = true
end
RSpec::Core::RakeTask.new(:spec) do |rt|
rt.ruby_opts = %w[-w]
end
FileList['benchmark/*.rb'].each do |path|
desc("Rough benchmark for #{File.basename(path)}")
task(path) do
ruby(path)
end
end
desc('Prevent miss packaging!')
task(:view_packaging_files) do
sh('rm -rf ./pkg')
sh('rake build')
cd('pkg') do
sh('gem unpack *.gem')
sh('tree -I *\.gem')
end
sh('rm -rf ./pkg')
end
task(:update) do
sh('dprint config update --yes')
end
desc 'Print dependencies'
task :deps do
sh('ruby --version')
sh('dprint --version')
sh('tree --version')
sh('typos --version')
end
desc 'Tests except ruby'
task :check_non_ruby do
sh('typos . .github .vscode')
sh('dprint check')
sh('nixpkgs-fmt --check ./*.nix')
end