-
Notifications
You must be signed in to change notification settings - Fork 385
/
Copy pathci.rake
63 lines (54 loc) · 1.43 KB
/
ci.rake
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
# frozen_string_literal: true
if Rails.env.development? || Rails.env.test?
# See tasks/linters.rake
task js_tests: :environment do
puts Rainbow("Running JavaScript tests").green
sh "yarn run test:client"
end
task rspec_tests: :environment do
puts Rainbow("Running RSpec tests").green
sh "rspec"
end
task build_rescript: :environment do
puts Rainbow("Building ReScript files").green
sh "yarn res:build"
end
namespace :ci do
desc "Run all audits and tests"
# rspec_tests must be before lint and js_tests to build the locale files
task all: %i[environment build_rescript rspec_tests lint js_tests] do
puts "All CI tasks"
puts Rainbow("PASSED").green
puts ""
rescue StandardError => e
puts e
puts Rainbow("FAILED").red
puts ""
raise(e)
end
desc "Run CI rspec tests"
task rspec: %i[environment build_rescript rspec_tests] do
puts "CI rspec tests"
puts Rainbow("PASSED").green
puts ""
rescue StandardError => e
puts e
puts Rainbow("FAILED").red
puts ""
raise(e)
end
desc "Run CI js_tests"
task js: %i[environment build_rescript js_tests] do
puts "CI js_tests"
puts Rainbow("PASSED").green
puts ""
rescue StandardError => e
puts e
puts Rainbow("FAILED").red
puts ""
raise(e)
end
end
task ci: "ci:all"
task(:default).clear.enhance([:ci])
end