rbs 3.9.4 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (354) hide show
  1. checksums.yaml +4 -4
  2. data/.clang-format +75 -0
  3. data/.clangd +2 -0
  4. data/.dockerignore +37 -0
  5. data/.gitattributes +1 -0
  6. data/.github/dependabot.yml +16 -14
  7. data/.github/workflows/bundle-update.yml +63 -0
  8. data/.github/workflows/c-check.yml +66 -0
  9. data/.github/workflows/changelog.yml +121 -0
  10. data/.github/workflows/comments.yml +6 -4
  11. data/.github/workflows/dependabot.yml +2 -2
  12. data/.github/workflows/jruby.yml +74 -0
  13. data/.github/workflows/release-gems.yml +234 -0
  14. data/.github/workflows/ruby.yml +86 -32
  15. data/.github/workflows/rust.yml +186 -0
  16. data/.github/workflows/truffleruby.yml +54 -0
  17. data/.github/workflows/typecheck.yml +6 -3
  18. data/.github/workflows/wasm.yml +55 -0
  19. data/.github/workflows/windows.yml +10 -4
  20. data/.gitignore +16 -0
  21. data/.rubocop.yml +1 -2
  22. data/CHANGELOG.md +502 -0
  23. data/Dockerfile.jruby +53 -0
  24. data/README.md +42 -5
  25. data/Rakefile +892 -111
  26. data/Steepfile +11 -0
  27. data/config.yml +665 -62
  28. data/core/array.rbs +541 -398
  29. data/core/basic_object.rbs +9 -8
  30. data/core/binding.rbs +0 -2
  31. data/core/builtin.rbs +9 -8
  32. data/core/class.rbs +11 -8
  33. data/core/comparable.rbs +55 -34
  34. data/core/complex.rbs +104 -78
  35. data/core/dir.rbs +61 -49
  36. data/core/encoding.rbs +12 -15
  37. data/core/enumerable.rbs +297 -196
  38. data/core/enumerator/arithmetic_sequence.rbs +70 -0
  39. data/core/enumerator/product.rbs +5 -5
  40. data/core/enumerator.rbs +91 -28
  41. data/core/errno.rbs +11 -2
  42. data/core/errors.rbs +58 -29
  43. data/core/exception.rbs +13 -13
  44. data/core/fiber.rbs +74 -54
  45. data/core/file.rbs +260 -1151
  46. data/core/file_constants.rbs +463 -0
  47. data/core/file_stat.rbs +534 -0
  48. data/core/file_test.rbs +3 -3
  49. data/core/float.rbs +257 -116
  50. data/core/gc.rbs +425 -281
  51. data/core/hash.rbs +1151 -829
  52. data/core/integer.rbs +156 -195
  53. data/core/io/buffer.rbs +53 -42
  54. data/core/io/wait.rbs +13 -35
  55. data/core/io.rbs +222 -155
  56. data/core/kernel.rbs +239 -163
  57. data/core/marshal.rbs +4 -4
  58. data/core/match_data.rbs +16 -14
  59. data/core/math.rbs +107 -66
  60. data/core/method.rbs +69 -33
  61. data/core/module.rbs +302 -150
  62. data/core/nil_class.rbs +7 -6
  63. data/core/numeric.rbs +77 -63
  64. data/core/object.rbs +9 -11
  65. data/core/object_space/weak_key_map.rbs +7 -7
  66. data/core/object_space.rbs +30 -23
  67. data/core/pathname.rbs +1312 -0
  68. data/core/proc.rbs +95 -58
  69. data/core/process.rbs +222 -202
  70. data/core/ractor.rbs +364 -518
  71. data/core/random.rbs +21 -3
  72. data/core/range.rbs +181 -79
  73. data/core/rational.rbs +60 -89
  74. data/core/rbs/ops.rbs +154 -0
  75. data/core/rbs/unnamed/argf.rbs +63 -56
  76. data/core/rbs/unnamed/env_class.rbs +19 -14
  77. data/core/rbs/unnamed/main_class.rbs +123 -0
  78. data/core/rbs/unnamed/random.rbs +11 -118
  79. data/core/regexp.rbs +258 -214
  80. data/core/ruby.rbs +53 -0
  81. data/core/ruby_vm.rbs +78 -34
  82. data/core/rubygems/config_file.rbs +5 -5
  83. data/core/rubygems/errors.rbs +6 -70
  84. data/core/rubygems/requirement.rbs +5 -15
  85. data/core/rubygems/rubygems.rbs +18 -81
  86. data/core/rubygems/specification.rbs +8 -0
  87. data/core/rubygems/version.rbs +2 -163
  88. data/core/set.rbs +493 -363
  89. data/core/signal.rbs +26 -16
  90. data/core/string.rbs +3234 -1285
  91. data/core/struct.rbs +43 -42
  92. data/core/symbol.rbs +41 -34
  93. data/core/thread.rbs +139 -83
  94. data/core/time.rbs +81 -50
  95. data/core/trace_point.rbs +41 -35
  96. data/core/true_class.rbs +2 -2
  97. data/core/unbound_method.rbs +24 -16
  98. data/core/warning.rbs +7 -7
  99. data/docs/CONTRIBUTING.md +3 -2
  100. data/docs/aliases.md +79 -0
  101. data/docs/collection.md +3 -3
  102. data/docs/config.md +171 -0
  103. data/docs/encoding.md +56 -0
  104. data/docs/gem.md +0 -1
  105. data/docs/inline.md +634 -0
  106. data/docs/rbs_by_example.md +20 -20
  107. data/docs/release.md +303 -0
  108. data/docs/rust.md +96 -0
  109. data/docs/sigs.md +3 -3
  110. data/docs/stdlib.md +8 -0
  111. data/docs/syntax.md +60 -18
  112. data/docs/type_fingerprint.md +21 -0
  113. data/docs/wasm_serialization.md +80 -0
  114. data/exe/rbs +1 -1
  115. data/ext/rbs_extension/ast_translation.c +1870 -0
  116. data/ext/rbs_extension/ast_translation.h +41 -0
  117. data/ext/rbs_extension/class_constants.c +189 -0
  118. data/{include/rbs/constants.h → ext/rbs_extension/class_constants.h} +24 -1
  119. data/ext/rbs_extension/compat.h +10 -0
  120. data/ext/rbs_extension/extconf.rb +26 -1
  121. data/ext/rbs_extension/legacy_location.c +299 -0
  122. data/ext/rbs_extension/legacy_location.h +82 -0
  123. data/ext/rbs_extension/main.c +639 -23
  124. data/ext/rbs_extension/rbs_extension.h +6 -21
  125. data/ext/rbs_extension/rbs_string_bridging.c +9 -0
  126. data/ext/rbs_extension/rbs_string_bridging.h +24 -0
  127. data/include/rbs/ast.h +1055 -0
  128. data/include/rbs/defines.h +104 -0
  129. data/include/rbs/lexer.h +208 -0
  130. data/include/rbs/location.h +40 -0
  131. data/include/rbs/parser.h +187 -0
  132. data/include/rbs/serialize.h +39 -0
  133. data/include/rbs/string.h +47 -0
  134. data/include/rbs/util/rbs_allocator.h +59 -0
  135. data/include/rbs/util/rbs_assert.h +20 -0
  136. data/include/rbs/util/rbs_buffer.h +83 -0
  137. data/include/rbs/util/rbs_constant_pool.h +6 -70
  138. data/include/rbs/util/rbs_encoding.h +282 -0
  139. data/include/rbs/util/rbs_unescape.h +24 -0
  140. data/include/rbs.h +9 -2
  141. data/lib/rbs/annotate/formatter.rb +3 -13
  142. data/lib/rbs/annotate/rdoc_annotator.rb +30 -32
  143. data/lib/rbs/annotate/rdoc_source.rb +1 -1
  144. data/lib/rbs/ast/annotation.rb +1 -1
  145. data/lib/rbs/ast/comment.rb +1 -1
  146. data/lib/rbs/ast/declarations.rb +11 -11
  147. data/lib/rbs/ast/members.rb +14 -14
  148. data/lib/rbs/ast/ruby/annotations.rb +451 -0
  149. data/lib/rbs/ast/ruby/comment_block.rb +247 -0
  150. data/lib/rbs/ast/ruby/declarations.rb +291 -0
  151. data/lib/rbs/ast/ruby/helpers/constant_helper.rb +28 -0
  152. data/lib/rbs/ast/ruby/helpers/location_helper.rb +15 -0
  153. data/lib/rbs/ast/ruby/members.rb +762 -0
  154. data/lib/rbs/ast/type_param.rb +25 -5
  155. data/lib/rbs/buffer.rb +142 -20
  156. data/lib/rbs/cli/diff.rb +16 -15
  157. data/lib/rbs/cli/validate.rb +63 -126
  158. data/lib/rbs/cli.rb +59 -29
  159. data/lib/rbs/collection/config/lockfile_generator.rb +28 -3
  160. data/lib/rbs/collection/sources/git.rb +7 -0
  161. data/lib/rbs/definition.rb +6 -1
  162. data/lib/rbs/definition_builder/ancestor_builder.rb +129 -70
  163. data/lib/rbs/definition_builder/method_builder.rb +74 -33
  164. data/lib/rbs/definition_builder.rb +181 -21
  165. data/lib/rbs/diff.rb +7 -1
  166. data/lib/rbs/environment/class_entry.rb +81 -0
  167. data/lib/rbs/environment/module_entry.rb +91 -0
  168. data/lib/rbs/environment.rb +410 -215
  169. data/lib/rbs/environment_loader.rb +2 -8
  170. data/lib/rbs/errors.rb +31 -21
  171. data/lib/rbs/inline_parser/comment_association.rb +117 -0
  172. data/lib/rbs/inline_parser.rb +568 -0
  173. data/lib/rbs/location_aux.rb +36 -4
  174. data/lib/rbs/locator.rb +5 -1
  175. data/lib/rbs/method_type.rb +5 -3
  176. data/lib/rbs/namespace.rb +47 -18
  177. data/lib/rbs/parser_aux.rb +37 -7
  178. data/lib/rbs/prototype/helpers.rb +24 -0
  179. data/lib/rbs/prototype/rb.rb +3 -28
  180. data/lib/rbs/prototype/rbi.rb +196 -45
  181. data/lib/rbs/prototype/runtime/value_object_generator.rb +0 -1
  182. data/lib/rbs/prototype/runtime.rb +13 -3
  183. data/lib/rbs/resolver/constant_resolver.rb +2 -2
  184. data/lib/rbs/resolver/type_name_resolver.rb +120 -44
  185. data/lib/rbs/rewriter.rb +70 -0
  186. data/lib/rbs/source.rb +99 -0
  187. data/lib/rbs/subtractor.rb +7 -4
  188. data/lib/rbs/test/type_check.rb +25 -3
  189. data/lib/rbs/type_name.rb +34 -21
  190. data/lib/rbs/types.rb +135 -81
  191. data/lib/rbs/unit_test/convertibles.rb +1 -0
  192. data/lib/rbs/unit_test/type_assertions.rb +47 -11
  193. data/lib/rbs/validator.rb +2 -2
  194. data/lib/rbs/version.rb +1 -1
  195. data/lib/rbs/wasm/deserializer.rb +213 -0
  196. data/lib/rbs/wasm/location.rb +61 -0
  197. data/lib/rbs/wasm/parser.rb +174 -0
  198. data/lib/rbs/wasm/runtime.rb +211 -0
  199. data/lib/rbs/wasm/serialization_schema.rb +111 -0
  200. data/lib/rbs.rb +25 -2
  201. data/lib/rbs_jars.rb +39 -0
  202. data/lib/rdoc/discover.rb +1 -1
  203. data/lib/rdoc_plugin/parser.rb +8 -3
  204. data/rbs.gemspec +34 -6
  205. data/schema/function.json +12 -1
  206. data/schema/typeParam.json +17 -1
  207. data/sig/ancestor_builder.rbs +1 -1
  208. data/sig/annotate/formatter.rbs +2 -2
  209. data/sig/annotate/rdoc_annotater.rbs +13 -10
  210. data/sig/ast/ruby/annotations.rbs +470 -0
  211. data/sig/ast/ruby/comment_block.rbs +127 -0
  212. data/sig/ast/ruby/declarations.rbs +158 -0
  213. data/sig/ast/ruby/helpers/constant_helper.rbs +11 -0
  214. data/sig/ast/ruby/helpers/location_helper.rbs +15 -0
  215. data/sig/ast/ruby/members.rbs +198 -0
  216. data/sig/buffer.rbs +81 -5
  217. data/sig/cli/diff.rbs +5 -11
  218. data/sig/cli/validate.rbs +12 -8
  219. data/sig/cli.rbs +18 -18
  220. data/sig/collection/config/lockfile_generator.rbs +2 -0
  221. data/sig/definition.rbs +6 -0
  222. data/sig/definition_builder.rbs +3 -1
  223. data/sig/environment/class_entry.rbs +56 -0
  224. data/sig/environment/module_entry.rbs +65 -0
  225. data/sig/environment.rbs +94 -87
  226. data/sig/errors.rbs +26 -20
  227. data/sig/inline_parser/comment_association.rbs +71 -0
  228. data/sig/inline_parser.rbs +126 -0
  229. data/sig/location.rbs +32 -7
  230. data/sig/locator.rbs +0 -2
  231. data/sig/manifest.yaml +0 -2
  232. data/sig/method_builder.rbs +9 -4
  233. data/sig/namespace.rbs +20 -5
  234. data/sig/parser.rbs +79 -15
  235. data/sig/prototype/helpers.rbs +2 -0
  236. data/sig/prototype/rbi.rbs +33 -4
  237. data/sig/resolver/type_name_resolver.rbs +36 -10
  238. data/sig/rewriter.rbs +45 -0
  239. data/sig/source.rbs +48 -0
  240. data/sig/type_param.rbs +13 -8
  241. data/sig/typename.rbs +15 -5
  242. data/sig/types.rbs +21 -9
  243. data/sig/unit_test/spy.rbs +0 -8
  244. data/sig/unit_test/type_assertions.rbs +17 -2
  245. data/sig/wasm/deserializer.rbs +66 -0
  246. data/sig/wasm/serialization_schema.rbs +13 -0
  247. data/src/ast.c +1644 -0
  248. data/src/lexer.c +3223 -0
  249. data/src/lexer.re +187 -0
  250. data/src/lexstate.c +222 -0
  251. data/src/location.c +31 -0
  252. data/src/parser.c +4318 -0
  253. data/src/serialize.c +965 -0
  254. data/src/string.c +41 -0
  255. data/src/util/rbs_allocator.c +171 -0
  256. data/src/util/rbs_assert.c +19 -0
  257. data/src/util/rbs_buffer.c +54 -0
  258. data/src/util/rbs_constant_pool.c +18 -92
  259. data/src/util/rbs_encoding.c +21454 -0
  260. data/src/util/rbs_unescape.c +167 -0
  261. data/stdlib/abbrev/0/array.rbs +1 -1
  262. data/stdlib/bigdecimal/0/big_decimal.rbs +116 -98
  263. data/stdlib/bigdecimal-math/0/big_math.rbs +169 -8
  264. data/stdlib/cgi/0/core.rbs +9 -393
  265. data/stdlib/cgi/0/manifest.yaml +1 -0
  266. data/stdlib/cgi-escape/0/escape.rbs +171 -0
  267. data/stdlib/coverage/0/coverage.rbs +7 -4
  268. data/stdlib/csv/0/csv.rbs +5 -5
  269. data/stdlib/date/0/date.rbs +92 -79
  270. data/stdlib/date/0/date_time.rbs +25 -24
  271. data/stdlib/delegate/0/delegator.rbs +11 -7
  272. data/stdlib/did_you_mean/0/did_you_mean.rbs +17 -16
  273. data/stdlib/digest/0/digest.rbs +117 -1
  274. data/stdlib/erb/0/erb.rbs +754 -353
  275. data/stdlib/etc/0/etc.rbs +73 -54
  276. data/stdlib/fileutils/0/fileutils.rbs +179 -160
  277. data/stdlib/forwardable/0/forwardable.rbs +13 -10
  278. data/stdlib/io-console/0/io-console.rbs +2 -2
  279. data/stdlib/ipaddr/0/ipaddr.rbs +0 -5
  280. data/stdlib/json/0/json.rbs +232 -185
  281. data/stdlib/monitor/0/monitor.rbs +9 -9
  282. data/stdlib/net-http/0/net-http.rbs +162 -134
  283. data/stdlib/objspace/0/objspace.rbs +17 -34
  284. data/stdlib/open-uri/0/open-uri.rbs +48 -8
  285. data/stdlib/open3/0/open3.rbs +469 -10
  286. data/stdlib/openssl/0/openssl.rbs +521 -397
  287. data/stdlib/optparse/0/optparse.rbs +26 -17
  288. data/stdlib/pathname/0/pathname.rbs +11 -1381
  289. data/stdlib/pp/0/pp.rbs +9 -8
  290. data/stdlib/prettyprint/0/prettyprint.rbs +7 -7
  291. data/stdlib/pstore/0/pstore.rbs +35 -30
  292. data/stdlib/psych/0/psych.rbs +65 -12
  293. data/stdlib/psych/0/store.rbs +2 -4
  294. data/stdlib/pty/0/pty.rbs +9 -6
  295. data/stdlib/random-formatter/0/random-formatter.rbs +277 -0
  296. data/stdlib/rdoc/0/code_object.rbs +4 -3
  297. data/stdlib/rdoc/0/comment.rbs +2 -0
  298. data/stdlib/rdoc/0/options.rbs +76 -0
  299. data/stdlib/rdoc/0/parser.rbs +1 -1
  300. data/stdlib/rdoc/0/rdoc.rbs +7 -5
  301. data/stdlib/rdoc/0/store.rbs +2 -2
  302. data/stdlib/resolv/0/resolv.rbs +26 -69
  303. data/stdlib/ripper/0/ripper.rbs +25 -19
  304. data/stdlib/securerandom/0/manifest.yaml +2 -0
  305. data/stdlib/securerandom/0/securerandom.rbs +7 -20
  306. data/stdlib/shellwords/0/shellwords.rbs +3 -3
  307. data/stdlib/singleton/0/singleton.rbs +6 -0
  308. data/stdlib/socket/0/addrinfo.rbs +9 -9
  309. data/stdlib/socket/0/basic_socket.rbs +3 -3
  310. data/stdlib/socket/0/ip_socket.rbs +10 -8
  311. data/stdlib/socket/0/socket.rbs +23 -10
  312. data/stdlib/socket/0/tcp_server.rbs +1 -1
  313. data/stdlib/socket/0/tcp_socket.rbs +11 -3
  314. data/stdlib/socket/0/udp_socket.rbs +1 -1
  315. data/stdlib/socket/0/unix_server.rbs +1 -1
  316. data/stdlib/stringio/0/stringio.rbs +1211 -96
  317. data/stdlib/strscan/0/string_scanner.rbs +101 -80
  318. data/stdlib/tempfile/0/manifest.yaml +3 -0
  319. data/stdlib/tempfile/0/tempfile.rbs +25 -21
  320. data/stdlib/time/0/time.rbs +8 -6
  321. data/stdlib/timeout/0/timeout.rbs +58 -7
  322. data/stdlib/tsort/0/cyclic.rbs +4 -1
  323. data/stdlib/tsort/0/interfaces.rbs +8 -8
  324. data/stdlib/tsort/0/tsort.rbs +16 -15
  325. data/stdlib/uri/0/common.rbs +42 -20
  326. data/stdlib/uri/0/file.rbs +3 -3
  327. data/stdlib/uri/0/generic.rbs +21 -18
  328. data/stdlib/uri/0/http.rbs +2 -2
  329. data/stdlib/uri/0/ldap.rbs +2 -2
  330. data/stdlib/uri/0/mailto.rbs +3 -3
  331. data/stdlib/uri/0/rfc2396_parser.rbs +12 -12
  332. data/stdlib/zlib/0/deflate.rbs +4 -3
  333. data/stdlib/zlib/0/gzip_file.rbs +1 -1
  334. data/stdlib/zlib/0/gzip_reader.rbs +8 -8
  335. data/stdlib/zlib/0/gzip_writer.rbs +16 -13
  336. data/stdlib/zlib/0/inflate.rbs +1 -1
  337. data/stdlib/zlib/0/need_dict.rbs +1 -1
  338. data/wasm/README.md +109 -0
  339. data/wasm/rbs_wasm.c +479 -0
  340. metadata +133 -19
  341. data/ext/rbs_extension/lexer.c +0 -2728
  342. data/ext/rbs_extension/lexer.h +0 -179
  343. data/ext/rbs_extension/lexer.re +0 -147
  344. data/ext/rbs_extension/lexstate.c +0 -175
  345. data/ext/rbs_extension/location.c +0 -325
  346. data/ext/rbs_extension/location.h +0 -85
  347. data/ext/rbs_extension/parser.c +0 -2982
  348. data/ext/rbs_extension/parser.h +0 -18
  349. data/ext/rbs_extension/parserstate.c +0 -411
  350. data/ext/rbs_extension/parserstate.h +0 -163
  351. data/ext/rbs_extension/unescape.c +0 -32
  352. data/include/rbs/ruby_objs.h +0 -72
  353. data/src/constants.c +0 -153
  354. data/src/ruby_objs.c +0 -799
@@ -0,0 +1,234 @@
1
+ name: Release gems
2
+
3
+ # Builds, publishes, and announces a release. Dispatch it with the commit being
4
+ # released and the version that commit declares.
5
+ #
6
+ # Everything is built from `commit`, not from wherever the default branch happens to
7
+ # be when the run starts, so the release describes a state that is already immutable.
8
+ # `version` is the same fact stated a second time -- the run stops before anything is
9
+ # built unless it matches the `RBS::VERSION` of that commit, so dispatching the wrong
10
+ # commit, or the right one under the wrong name, is a failed run rather than a gem
11
+ # that has to be yanked.
12
+ #
13
+ # `dry_run` builds and checks both gems and stops before the tag, which is how the
14
+ # build is exercised without releasing anything.
15
+ #
16
+ # | Gem | Platform | Parser |
17
+ # | -------------------- | ------------- | -------------------------------- |
18
+ # | `rbs-X.Y.Z.gem` | `ruby` (MRI) | C extension, compiled on install |
19
+ # | `rbs-X.Y.Z-java.gem` | `java` (JRuby)| `rbs_parser.wasm`, prebuilt here |
20
+ #
21
+ # See docs/release.md. The `java` gem is built on CRuby: the platform comes from
22
+ # `RBS_PLATFORM`, not from the engine running `gem build`. JRuby is only needed to
23
+ # run the result, which the workflow does before it would publish anything.
24
+ #
25
+ # One job on purpose. Tagging, pushing the gems, and opening the GitHub release
26
+ # all belong to a single release, and keeping them in one place keeps their order
27
+ # readable -- the tag is created once both gems are known to build and run, and
28
+ # before anything is published, so the reversible step comes before the irreversible
29
+ # one.
30
+ #
31
+ # The file name is what the RubyGems trusted publisher for `rbs` is registered
32
+ # against, so it cannot be renamed without registering the new name first.
33
+
34
+ on:
35
+ workflow_dispatch:
36
+ inputs:
37
+ commit:
38
+ description: "Commit to release, as a full 40-character SHA"
39
+ required: true
40
+ version:
41
+ description: "Version to release, without the leading `v` (e.g. `4.1.2`)"
42
+ required: true
43
+ dry_run:
44
+ description: "Build and check the gems without tagging or publishing anything"
45
+ type: boolean
46
+ default: false
47
+
48
+ permissions:
49
+ contents: read
50
+
51
+ env:
52
+ # Keep in sync with .github/workflows/wasm.yml and .github/workflows/jruby.yml.
53
+ WASI_SDK_VERSION: "33"
54
+ WASI_SDK_RELEASE: "33.0"
55
+
56
+ jobs:
57
+ release:
58
+ name: release
59
+ runs-on: ubuntu-latest
60
+ permissions:
61
+ contents: write # push the tag, publish the GitHub release
62
+ id-token: write # trusted publishing to RubyGems
63
+ env:
64
+ # The inputs are read through the environment rather than interpolated into
65
+ # the scripts below.
66
+ COMMIT: ${{ inputs.commit }}
67
+ VERSION: ${{ inputs.version }}
68
+ TAG: v${{ inputs.version }}
69
+ steps:
70
+ # The gemspec takes its file list from `git ls-files`, so both gems are built
71
+ # from the committed state -- of the dispatched commit, since that is what is
72
+ # checked out. The full history is needed to tell which branches contain it.
73
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
74
+ with:
75
+ ref: ${{ inputs.commit }}
76
+ fetch-depth: 0
77
+
78
+ # Before anything is installed or built: these are the two things the release
79
+ # is named after and built from, and a mistake in either is cheapest to catch
80
+ # here.
81
+ - name: Check the inputs
82
+ run: |
83
+ if [[ ! "$COMMIT" =~ ^[0-9a-f]{40}$ ]]; then
84
+ echo "::error::\`$COMMIT\` is not a full 40-character SHA. A release names one exact commit."
85
+ exit 1
86
+ fi
87
+ if [[ ! "$VERSION" =~ ^[0-9][0-9a-zA-Z.]*$ ]]; then
88
+ echo "::error::\`$VERSION\` is not a version number. Pass it without the leading \`v\`."
89
+ exit 1
90
+ fi
91
+
92
+ # A release proper is cut from the default branch, while a patch release can
93
+ # be cut from a release branch, so which branch the commit is on is not this
94
+ # workflow's business. That it is on one is: a commit no branch contains is
95
+ # one that nothing in the repository leads to any more.
96
+ git fetch --no-tags origin "+refs/heads/*:refs/remotes/origin/*"
97
+ branches=$(git branch --remotes --contains "$COMMIT" --format "%(refname:lstrip=3)")
98
+ if [ -z "$branches" ]; then
99
+ echo "::error::$COMMIT is not on any branch."
100
+ exit 1
101
+ fi
102
+ echo "Branches containing $COMMIT:"
103
+ printf '%s\n' "$branches"
104
+
105
+ # A tag that already exists is a version that has already been released, and
106
+ # pushing it would fail after the build rather than before it.
107
+ - name: Check that the tag does not exist
108
+ if: ${{ !inputs.dry_run }}
109
+ run: |
110
+ if git ls-remote --exit-code --tags origin "refs/tags/$TAG" > /dev/null; then
111
+ echo "::error::$TAG already exists, so $VERSION has been released."
112
+ exit 1
113
+ fi
114
+
115
+ - name: Set up Ruby
116
+ uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
117
+ with:
118
+ ruby-version: ruby
119
+ bundler: none
120
+ - name: Update rubygems & bundler
121
+ run: gem update --system
122
+ - name: Install gems
123
+ run: |
124
+ bundle config set --local without libs:profilers
125
+ bundle install --jobs 4 --retry 3
126
+
127
+ # Fails before a minute is spent on the build, and before anything is pushed:
128
+ # the version has to be the one the released commit declares, and -- unless
129
+ # this is a `.dev.N` release -- the one CHANGELOG.md is written up for.
130
+ - name: Check the version and the changelog
131
+ run: bundle exec rake "gem:check_release[$VERSION]"
132
+
133
+ - name: Build the ruby gem
134
+ run: |
135
+ mkdir -p pkg
136
+ gem build rbs.gemspec -o "pkg/rbs-$VERSION.gem"
137
+
138
+ # `rake wasm:jruby_setup` compiles src/**/*.c to WebAssembly and copies the
139
+ # result to lib/rbs/wasm/, where the gemspec picks it up. clang runs as a
140
+ # subprocess, so this works on CRuby.
141
+ - name: Install the WASI SDK
142
+ run: |
143
+ url="https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_RELEASE}-x86_64-linux.tar.gz"
144
+ mkdir -p "$HOME/wasi-sdk"
145
+ curl -sSL "$url" | tar xz --strip-components=1 -C "$HOME/wasi-sdk"
146
+ echo "WASI_SDK_PATH=$HOME/wasi-sdk" >> "$GITHUB_ENV"
147
+ - name: Build rbs_parser.wasm
148
+ run: bundle exec rake wasm:jruby_setup
149
+
150
+ - name: Build the java gem
151
+ env:
152
+ RBS_PLATFORM: java
153
+ run: gem build rbs.gemspec -o "pkg/rbs-$VERSION-java.gem"
154
+
155
+ # `git ls-files` vouches for everything else, but rbs_parser.wasm is a build
156
+ # artifact, so the java gem is the one that can come out quietly wrong.
157
+ - name: Check the built gems
158
+ run: |
159
+ ruby -rrubygems/package -e '
160
+ ruby_gem, java_gem = ARGV.map { Gem::Package.new(_1).spec }
161
+
162
+ raise "unexpected platform: #{ruby_gem.platform}" unless ruby_gem.platform.to_s == "ruby"
163
+ raise "the C extension is not declared" if ruby_gem.extensions.empty?
164
+
165
+ raise "unexpected platform: #{java_gem.platform}" unless java_gem.platform.to_s == "java"
166
+ raise "rbs_parser.wasm is missing" unless java_gem.files.include?("lib/rbs/wasm/rbs_parser.wasm")
167
+ raise "the java gem must not declare an extension" unless java_gem.extensions.empty?
168
+
169
+ [ruby_gem, java_gem].each { puts "#{_1.full_name}: #{_1.files.size} files" }
170
+ ' "pkg/rbs-$VERSION.gem" "pkg/rbs-$VERSION-java.gem"
171
+
172
+ # The checks above cannot tell whether rbs_parser.wasm actually runs. Install
173
+ # the gem the way a user would -- jar-dependencies fetches Chicory and ASM
174
+ # from Maven during the install -- and parse something with it, so the
175
+ # WebAssembly runtime is exercised end to end before anything is published.
176
+ - name: Set up JRuby
177
+ uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
178
+ with:
179
+ ruby-version: jruby
180
+ bundler: none
181
+ - name: Check the java gem on JRuby
182
+ run: |
183
+ gem install "pkg/rbs-$VERSION-java.gem"
184
+ ruby -e '
185
+ require "rbs"
186
+ _, _, decls = RBS::Parser.parse_signature("class Foo end")
187
+ names = decls.map { _1.name.to_s }
188
+ raise "parsed #{names.inspect}, expected [\"Foo\"]" unless names == ["Foo"]
189
+ puts "#{RUBY_ENGINE} #{RUBY_VERSION}: rbs #{RBS::VERSION} parses through the WebAssembly runtime"
190
+ '
191
+
192
+ - name: Switch back to CRuby
193
+ uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
194
+ with:
195
+ ruby-version: ruby
196
+ bundler: none
197
+
198
+ # Uploaded before publishing, so a failed push still leaves the gems behind.
199
+ # This is also where a dry run ends.
200
+ - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
201
+ with:
202
+ name: gems
203
+ path: pkg/*.gem
204
+ if-no-files-found: error
205
+
206
+ # Everything below runs only for a real release.
207
+
208
+ # The tag comes after the gems are known to build and run, and before anything
209
+ # is published: a tag can be deleted, while a version pushed to RubyGems can
210
+ # only be yanked. What it names was decided by the checkout rather than by the
211
+ # tagging, so nothing rests on it being created first.
212
+ - name: Tag the release
213
+ if: ${{ !inputs.dry_run }}
214
+ run: |
215
+ git config user.name "github-actions[bot]"
216
+ git config user.email "github-actions[bot]@users.noreply.github.com"
217
+ bundle exec rake gem:tag
218
+
219
+ - name: Configure RubyGems credentials
220
+ if: ${{ !inputs.dry_run }}
221
+ uses: rubygems/configure-rubygems-credentials@dc5a8d8553e6ee01fc26761a49e99e733d17954a # v2.1.0
222
+
223
+ - name: Push the gems
224
+ if: ${{ !inputs.dry_run }}
225
+ run: |
226
+ gem push "pkg/rbs-$VERSION.gem"
227
+ gem push "pkg/rbs-$VERSION-java.gem"
228
+
229
+ # Last, so that a failed push never announces a release that has no gems.
230
+ - name: Publish the GitHub release
231
+ if: ${{ !inputs.dry_run }}
232
+ env:
233
+ GH_TOKEN: ${{ github.token }}
234
+ run: bundle exec rake gem:gh_release
@@ -7,38 +7,41 @@ on:
7
7
  pull_request: {}
8
8
  merge_group: {}
9
9
 
10
+ permissions:
11
+ contents: read
12
+
10
13
  jobs:
11
14
  test:
12
15
  runs-on: "ubuntu-latest"
13
16
  strategy:
14
17
  fail-fast: false
15
18
  matrix:
16
- ruby: ['3.1', '3.2', '3.3', '3.4', head]
19
+ ruby: ['3.3', '3.4', '4.0', head]
17
20
  rubyopt: [""]
18
21
  job:
19
22
  - test
20
23
  include:
21
24
  - ruby: head
22
25
  job: stdlib_test rubocop
23
- - ruby: "3.4"
26
+ - ruby: "4.0"
24
27
  job: stdlib_test
25
- - ruby: "3.4"
28
+ - ruby: "4.0"
26
29
  job: test
27
30
  rubyopt: "--enable-frozen-string-literal"
28
- - ruby: "3.4"
31
+ - ruby: "4.0"
29
32
  job: stdlib_test
30
33
  rubyopt: "--enable-frozen-string-literal"
31
- - ruby: "3.4"
32
- job: lexer templates compile confirm_lexer confirm_templates
33
- - ruby: "3.4"
34
+ - ruby: "4.0"
34
35
  job: rubocop validate test_doc build test_generate_stdlib raap
35
- - ruby: "3.4"
36
+ - ruby: "4.0"
36
37
  job: typecheck_test
38
+ - ruby: asan-release
39
+ job: test
37
40
  env:
38
41
  RANDOMIZE_STDLIB_TEST_ORDER: "true"
39
42
  steps:
40
- - uses: actions/checkout@v4
41
- - uses: ruby/setup-ruby@v1
43
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
44
+ - uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
42
45
  with:
43
46
  ruby-version: ${{ matrix.ruby }}
44
47
  bundler: none
@@ -48,26 +51,24 @@ jobs:
48
51
  run: |
49
52
  sudo apt-get update
50
53
  sudo apt-get install -y libdb-dev curl autoconf automake m4 libtool python3
51
- - name: Install Re2c
52
- if: ${{ contains(matrix.job, 'lexer') }}
53
- run: |
54
- cd /tmp
55
- curl -L https://github.com/skvadrik/re2c/archive/refs/tags/3.1.tar.gz > re2c-3.1.tar.gz
56
- tar xf re2c-3.1.tar.gz
57
- cd re2c-3.1
58
- autoreconf -i -W all
59
- ./configure
60
- make
61
- sudo make install
62
54
  - name: Update rubygems & bundler
63
55
  run: |
64
56
  ruby -v
65
57
  gem update --system
58
+ - name: install erb
59
+ run: gem install erb
66
60
  - name: bundle config set with
67
61
  run: |
68
62
  echo "NO_MINITEST=true" >> $GITHUB_ENV
69
63
  bundle config set --local without 'minitest'
70
64
  if: ${{ contains(matrix.ruby, 'head') }}
65
+ - name: bundle config set force_ruby_platform true if head
66
+ if: ${{ contains(matrix.ruby, 'head') }}
67
+ run: |
68
+ bundle config set force_ruby_platform true
69
+ - name: Ignore Gemfile.lock's BUNDLED WITH on ruby-head
70
+ if: ${{ contains(matrix.ruby, 'head') }}
71
+ run: bundle config set --local version system
71
72
  - name: Skip installing type checkers
72
73
  if: ${{ ! contains(matrix.job, 'typecheck_test') }}
73
74
  run: |
@@ -75,30 +76,83 @@ jobs:
75
76
  - name: bin/setup
76
77
  run: |
77
78
  bin/setup
79
+ - name: Configure ASAN options
80
+ if: ${{ contains(matrix.ruby, 'asan') }}
81
+ run: |
82
+ echo "ASAN_OPTIONS=abort_on_error=1" >> $GITHUB_ENV
78
83
  - name: Run test
79
84
  run: |
80
85
  bundle exec rake ${{ matrix.job }}
81
- valgrind:
82
- runs-on: ubuntu-latest
86
+ C99_compile:
87
+ runs-on: macos-latest
88
+ strategy:
89
+ fail-fast: false
90
+ matrix:
91
+ ruby: ['4.0', head]
83
92
  steps:
84
- - uses: actions/checkout@v2
85
- - uses: ruby/setup-ruby@v1
93
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
94
+ - name: Install dependencies
95
+ run: |
96
+ brew install ruby-build
97
+ - uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
86
98
  with:
87
- ruby-version: "3.4"
88
- bundler-cache: none
99
+ ruby-version: ${{ matrix.ruby }}
100
+ bundler: none
89
101
  - name: Set working directory as safe
90
102
  run: git config --global --add safe.directory $(pwd)
103
+ - name: Update rubygems & bundler
104
+ run: |
105
+ ruby -v
106
+ gem update --system
107
+ - name: install erb
108
+ run: gem install erb
109
+ - name: clang version
110
+ run: clang --version
111
+ - name: bundle config set force_ruby_platform true if head
112
+ if: ${{ contains(matrix.ruby, 'head') }}
113
+ run: |
114
+ bundle config set force_ruby_platform true
115
+ - name: Ignore Gemfile.lock's BUNDLED WITH on ruby-head
116
+ if: ${{ contains(matrix.ruby, 'head') }}
117
+ run: bundle config set --local version system
118
+ - name: bin/setup
119
+ run: |
120
+ bin/setup
121
+ - run: bundle exec rake clean compile_c99
122
+
123
+ clang_compile:
124
+ runs-on: macos-latest
125
+ strategy:
126
+ fail-fast: false
127
+ matrix:
128
+ ruby: ['4.0', head]
129
+ steps:
130
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
91
131
  - name: Install dependencies
92
132
  run: |
93
- sudo apt-get update
94
- sudo apt-get install -y libdb-dev curl autoconf automake m4 libtool python3 valgrind
133
+ brew install ruby-build
134
+ - uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
135
+ with:
136
+ ruby-version: ${{ matrix.ruby }}
137
+ bundler: none
138
+ - name: Set working directory as safe
139
+ run: git config --global --add safe.directory $(pwd)
95
140
  - name: Update rubygems & bundler
96
141
  run: |
97
142
  ruby -v
98
143
  gem update --system
144
+ - name: install erb
145
+ run: gem install erb
146
+ - name: clang version
147
+ run: clang --version
148
+ - name: bundle config set force_ruby_platform true if head
149
+ if: ${{ contains(matrix.ruby, 'head') }}
150
+ run: |
151
+ bundle config set force_ruby_platform true
152
+ - name: Ignore Gemfile.lock's BUNDLED WITH on ruby-head
153
+ if: ${{ contains(matrix.ruby, 'head') }}
154
+ run: bundle config set --local version system
99
155
  - name: bin/setup
100
156
  run: |
101
157
  bin/setup
102
- - run: bundle exec rake test:valgrind
103
- env:
104
- RUBY_FREE_AT_EXIT: 1
158
+ - run: bundle exec rake clean compile
@@ -0,0 +1,186 @@
1
+ name: Rust
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ paths:
9
+ - ".github/workflows/rust.yml"
10
+ - "rust/**"
11
+ # `merge_group` has no `paths` filter, so this runs on every queue entry.
12
+ merge_group: {}
13
+
14
+ env:
15
+ RUSTFLAGS: "-D warnings"
16
+
17
+ permissions:
18
+ contents: read
19
+
20
+ jobs:
21
+ test:
22
+ name: cargo:test
23
+ runs-on: ${{ matrix.os }}
24
+ strategy:
25
+ fail-fast: false
26
+ matrix:
27
+ os: [ubuntu-latest, macos-latest, windows-latest]
28
+ steps:
29
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
30
+ - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
31
+ - name: Set up Ruby
32
+ uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
33
+ with:
34
+ ruby-version: ruby
35
+ bundler: none
36
+ - name: Update rubygems & bundler
37
+ run: gem update --system
38
+ - name: Install gems
39
+ run: |
40
+ bundle config set --local without libs:profilers
41
+ bundle install --jobs 4 --retry 3
42
+ - name: Set up vendored RBS source
43
+ run: bundle exec rake rust:rbs:sync
44
+ - name: Install Rust tools
45
+ run: |
46
+ rustup update --no-self-update stable
47
+ rustup default stable
48
+ - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
49
+ with:
50
+ path: |
51
+ ~/.cargo/registry
52
+ ~/.cargo/git
53
+ rust/target
54
+ key: ${{ runner.os }}-cargo-${{ hashFiles('rust/Cargo.lock') }}
55
+ restore-keys: |
56
+ ${{ runner.os }}-cargo-
57
+ - name: Run tests
58
+ run: |
59
+ cd rust
60
+ cargo test --verbose
61
+
62
+ publish-dry-run-ruby-rbs-sys:
63
+ name: rust:publish:ruby-rbs-sys
64
+ runs-on: ubuntu-latest
65
+ continue-on-error: true
66
+ steps:
67
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
68
+ - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
69
+ - name: Set up git identity
70
+ run: |
71
+ git config user.name "GitHub Actions"
72
+ git config user.email "actions@github.com"
73
+ - name: Set up Ruby
74
+ uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
75
+ with:
76
+ ruby-version: ruby
77
+ bundler: none
78
+ - name: Update rubygems & bundler
79
+ run: gem update --system
80
+ - name: Install gems
81
+ run: |
82
+ bundle config set --local without libs:profilers
83
+ bundle install --jobs 4 --retry 3
84
+ - name: Set up vendored RBS source
85
+ run: bundle exec rake rust:rbs:sync
86
+ - name: Install Rust tools
87
+ run: |
88
+ rustup update --no-self-update stable
89
+ rustup default stable
90
+ - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
91
+ with:
92
+ path: |
93
+ ~/.cargo/registry
94
+ ~/.cargo/git
95
+ rust/target
96
+ key: ${{ runner.os }}-cargo-${{ hashFiles('rust/Cargo.lock') }}
97
+ restore-keys: |
98
+ ${{ runner.os }}-cargo-
99
+ - name: Test publish ruby-rbs-sys
100
+ run: bundle exec rake rust:publish:ruby-rbs-sys
101
+ env:
102
+ RBS_RUST_PUBLISH_DRY_RUN: "1"
103
+
104
+ publish-dry-run-ruby-rbs:
105
+ name: rust:publish:ruby-rbs
106
+ runs-on: ubuntu-latest
107
+ continue-on-error: true
108
+ steps:
109
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
110
+ - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
111
+ - name: Set up git identity
112
+ run: |
113
+ git config user.name "GitHub Actions"
114
+ git config user.email "actions@github.com"
115
+ - name: Set up Ruby
116
+ uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
117
+ with:
118
+ ruby-version: ruby
119
+ bundler: none
120
+ - name: Update rubygems & bundler
121
+ run: gem update --system
122
+ - name: Install gems
123
+ run: |
124
+ bundle config set --local without libs:profilers
125
+ bundle install --jobs 4 --retry 3
126
+ - name: Set up vendored RBS source
127
+ run: bundle exec rake rust:rbs:sync
128
+ - name: Install Rust tools
129
+ run: |
130
+ rustup update --no-self-update stable
131
+ rustup default stable
132
+ - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
133
+ with:
134
+ path: |
135
+ ~/.cargo/registry
136
+ ~/.cargo/git
137
+ rust/target
138
+ key: ${{ runner.os }}-cargo-${{ hashFiles('rust/Cargo.lock') }}
139
+ restore-keys: |
140
+ ${{ runner.os }}-cargo-
141
+ - name: Test publish ruby-rbs
142
+ run: bundle exec rake rust:publish:ruby-rbs
143
+ env:
144
+ RBS_RUST_PUBLISH_DRY_RUN: "1"
145
+
146
+ lint:
147
+ name: cargo:lint
148
+ runs-on: ubuntu-latest
149
+ steps:
150
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
151
+ - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
152
+ - name: Set up Ruby
153
+ uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
154
+ with:
155
+ ruby-version: ruby
156
+ bundler: none
157
+ - name: Update rubygems & bundler
158
+ run: gem update --system
159
+ - name: Install gems
160
+ run: |
161
+ bundle config set --local without libs:profilers
162
+ bundle install --jobs 4 --retry 3
163
+ - name: Set up vendored RBS source
164
+ run: bundle exec rake rust:rbs:sync
165
+ - name: Install Rust tools
166
+ run: |
167
+ rustup update --no-self-update stable
168
+ rustup default stable
169
+ rustup component add --toolchain stable clippy rustfmt
170
+ - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
171
+ with:
172
+ path: |
173
+ ~/.cargo/registry
174
+ ~/.cargo/git
175
+ rust/target
176
+ key: ${{ runner.os }}-cargo-${{ hashFiles('rust/Cargo.lock') }}
177
+ restore-keys: |
178
+ ${{ runner.os }}-cargo-
179
+ - name: Check formatting
180
+ run: |
181
+ cd rust
182
+ cargo fmt --check
183
+ - name: Run clippy
184
+ run: |
185
+ cd rust
186
+ cargo clippy
@@ -0,0 +1,54 @@
1
+ name: TruffleRuby
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request: {}
8
+ merge_group: {}
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ test:
15
+ runs-on: "ubuntu-latest"
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ ruby: ['truffleruby']
20
+ job:
21
+ - test
22
+ env:
23
+ RANDOMIZE_STDLIB_TEST_ORDER: "true"
24
+ # TruffleRuby warns and falls back to US-ASCII unless the locale is UTF-8.
25
+ LANG: "en_US.UTF-8"
26
+ steps:
27
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
28
+ - uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
29
+ with:
30
+ ruby-version: ${{ matrix.ruby }}
31
+ bundler: none
32
+ - name: Set working directory as safe
33
+ run: git config --global --add safe.directory $(pwd)
34
+ - name: Install dependencies
35
+ run: |
36
+ sudo apt-get update
37
+ sudo apt-get install -y libdb-dev curl autoconf automake m4 libtool python3
38
+ - name: Update rubygems & bundler
39
+ run: |
40
+ ruby -v
41
+ gem update --system
42
+ - name: install erb
43
+ run: gem install erb
44
+ - name: bundle config
45
+ run: |
46
+ # Profilers and the typecheck tooling are not needed for the smoke test,
47
+ # and some of them do not support TruffleRuby.
48
+ bundle config set --local without 'profilers typecheck_test'
49
+ - name: bin/setup
50
+ run: |
51
+ bin/setup
52
+ - name: Run test
53
+ run: |
54
+ bundle exec rake ${{ matrix.job }}
@@ -7,16 +7,19 @@ on:
7
7
  pull_request: {}
8
8
  merge_group: {}
9
9
 
10
+ permissions:
11
+ contents: read
12
+
10
13
  jobs:
11
14
  steep:
12
15
  runs-on: "ubuntu-latest"
13
16
  strategy:
14
17
  fail-fast: false
15
18
  steps:
16
- - uses: actions/checkout@v4
17
- - uses: ruby/setup-ruby@v1
19
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
20
+ - uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
18
21
  with:
19
- ruby-version: "3.3"
22
+ ruby-version: "4.0"
20
23
  bundler: none
21
24
  - name: Set working directory as safe
22
25
  run: git config --global --add safe.directory $(pwd)