Skip to content

Commit 33d022f

Browse files
committed
Add check to make sure rbs files are up to date
1 parent 519c83d commit 33d022f

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ jobs:
4040
- name: Steep
4141
run: bundle exec steep check
4242

43+
- name: RBS Inline
44+
run: bundle exec rake rbs_inline
45+
4346
# - name: Sorbet
4447
# run: bundle exec srb tc
4548

Rakefile

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,21 @@ namespace :parse do
182182
end
183183

184184
task :rbs_inline do
185-
sh "bundle exec rbs-inline --opt-out --output=sig/ lib/"
185+
require "open3"
186+
187+
_stdout, stderr, status = Open3.capture3("bundle exec rbs-inline --opt-out --output=sig/ lib/")
188+
189+
if ENV["CI"]
190+
if stderr.strip == "🎉 Generated 0 RBS files under sig/"
191+
puts "RBS files in sig/ are up to date"
192+
exit status.exitstatus
193+
else
194+
puts "RBS files in sig/ are not up to date"
195+
exit 1
196+
end
197+
else
198+
exit status.exitstatus
199+
end
186200
end
187201

188202
task default: [:templates, :make, :compile, :test]

0 commit comments

Comments
 (0)