From 3142166fad39db80a88eac5b665e983851f82269 Mon Sep 17 00:00:00 2001 From: Soutaro Matsumoto Date: Fri, 29 Nov 2024 18:17:18 +0900 Subject: [PATCH] Confirm the generated code is up to date --- .github/workflows/ruby.yml | 2 +- Rakefile | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 71c6cbb78..dce16c017 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -29,7 +29,7 @@ jobs: job: stdlib_test rubyopt: "--enable-frozen-string-literal" - ruby: "3.3" - job: lexer compile confirm_lexer + job: lexer templates compile confirm_lexer confirm_templates - ruby: "3.3" job: rubocop validate test_doc build test_generate_stdlib raap - ruby: "3.3" diff --git a/Rakefile b/Rakefile index 19d0e3f97..908555fa8 100644 --- a/Rakefile +++ b/Rakefile @@ -30,6 +30,11 @@ task :confirm_lexer => :lexer do sh "git diff --exit-code ext/rbs_extension/lexer.c" end +task :confirm_templates => :templates do + puts "Testing if generated code under include and src is updated with respect to templates" + sh "git diff --exit-code -- include src" +end + rule ".c" => ".re" do |t| puts "⚠️⚠️⚠️ #{t.name} is older than #{t.source}. You may need to run `rake lexer` ⚠️⚠️⚠️" end