Repository navigation
Expand file tree
/
Copy pathRakefile
More file actions
68 lines (54 loc) · 1.63 KB
/
Copy pathRakefile
File metadata and controls
68 lines (54 loc) · 1.63 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
68
# frozen_string_literal: true
require "rake/testtask"
require "bundler/gem_tasks"
Rake::TestTask.new(:test) do |task|
task.libs << "test"
task.pattern = "test/**/*_test.rb"
task.warning = true
end
desc "Generate resources, models, RBS signatures, and event types"
task :generate do
sh "go", "-C", "codegen", "run", ".", "generate"
end
desc "Export the SDK code sample catalogue (optional output path)"
task :samples, [:output] do |_, args|
sh "go", "-C", "codegen", "run", ".", "samples", "--out", File.expand_path(args[:output] || "code-samples.json")
end
task test: :samples
namespace :generate do
desc "Check generated files without changing the working tree"
task :check do
sh "go", "-C", "codegen", "run", ".", "generate", "--check"
end
end
namespace :codegen do
desc "Test and vet the Go generator"
task :test do
sh "go", "-C", "codegen", "test", "./..."
sh "go", "-C", "codegen", "vet", "./..."
end
end
desc "Check Ruby style with StandardRB"
task :lint do
sh "standardrb"
end
desc "Format Ruby sources with StandardRB"
task :format do
sh "standardrb --fix"
end
desc "Validate shipped RBS signatures"
task :signatures do
sh "rbs -I sig validate"
end
desc "Generate API documentation"
task :docs do
sh "rdoc --main README.md --title 'SumUp Ruby SDK' README.md lib"
end
desc "Check runnable examples and operation code samples"
task examples: :samples do
Dir["examples/**/*.rb"].each { |path| ruby "-c", path }
ruby "-Ilib:test", "test/samples_test.rb"
end
desc "Run all checks required by CI"
task check: [:lint, :signatures, "generate:check", "codegen:test", :test, :examples, :build]
task default: :check