Skip to content

Commit fc5a049

Browse files
committed
Build recript files before test
1 parent 061c290 commit fc5a049

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

.github/workflows/js_test.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,5 @@ jobs:
4444
- name: Build i18n libraries
4545
run: bundle exec rake react_on_rails:locale
4646

47-
- name: Compile Rescript files
48-
run: yarn res:build
49-
5047
- name: Run js tests
5148
run: bundle exec rake ci:js

lib/tasks/ci.rake

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,15 @@ if Rails.env.development? || Rails.env.test?
1313
sh "rspec"
1414
end
1515

16+
task build_rescript: :environment do
17+
puts Rainbow("Building ReScript files").green
18+
sh "yarn res:build"
19+
end
20+
1621
namespace :ci do
1722
desc "Run all audits and tests"
1823
# rspec_tests must be before lint and js_tests to build the locale files
19-
task all: %i[environment rspec_tests lint js_tests] do
24+
task all: %i[environment build_rescript rspec_tests lint js_tests] do
2025
puts "All CI tasks"
2126
puts Rainbow("PASSED").green
2227
puts ""
@@ -28,7 +33,7 @@ if Rails.env.development? || Rails.env.test?
2833
end
2934

3035
desc "Run CI rspec tests"
31-
task rspec: %i[environment rspec_tests] do
36+
task rspec: %i[environment build_rescript rspec_tests] do
3237
puts "CI rspec tests"
3338
puts Rainbow("PASSED").green
3439
puts ""
@@ -40,7 +45,7 @@ if Rails.env.development? || Rails.env.test?
4045
end
4146

4247
desc "Run CI js_tests"
43-
task js: %i[environment js_tests] do
48+
task js: %i[environment build_rescript js_tests] do
4449
puts "CI js_tests"
4550
puts Rainbow("PASSED").green
4651
puts ""

lib/tasks/linters.rake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ if %w[development test].include? Rails.env
5050
desc "See docs for task 'scss_lint'"
5151
task scss: :scss_lint
5252

53-
task lint: %i[rubocop js scss] do
53+
task lint: %i[build_rescript rubocop js scss] do
5454
puts "Completed all linting"
5555
end
5656
end

0 commit comments

Comments
 (0)