expressir 1.3.0-aarch64-linux-gnu

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. checksums.yaml +7 -0
  2. data/.cross_rubies +20 -0
  3. data/.github/workflows/rake.yml +313 -0
  4. data/.github/workflows/release.yml +181 -0
  5. data/.gitignore +23 -0
  6. data/.gitmodules +6 -0
  7. data/.hound.yml +3 -0
  8. data/.rspec +2 -0
  9. data/.rubocop.yml +18 -0
  10. data/.yardopts +11 -0
  11. data/Gemfile +4 -0
  12. data/README.adoc +155 -0
  13. data/Rakefile +17 -0
  14. data/bin/console +11 -0
  15. data/bin/rspec +29 -0
  16. data/bin/setup +8 -0
  17. data/docs/development.md +90 -0
  18. data/exe/expressir +22 -0
  19. data/exe/format +18 -0
  20. data/exe/format-test +81 -0
  21. data/exe/generate-parser +51 -0
  22. data/expressir.gemspec +48 -0
  23. data/lib/expressir/cli/ui.rb +36 -0
  24. data/lib/expressir/cli.rb +21 -0
  25. data/lib/expressir/config.rb +23 -0
  26. data/lib/expressir/express/2.7/express_parser.so +0 -0
  27. data/lib/expressir/express/3.0/express_parser.so +0 -0
  28. data/lib/expressir/express/3.1/express_parser.so +0 -0
  29. data/lib/expressir/express/3.2/express_parser.so +0 -0
  30. data/lib/expressir/express/cache.rb +51 -0
  31. data/lib/expressir/express/formatter.rb +1608 -0
  32. data/lib/expressir/express/hyperlink_formatter.rb +36 -0
  33. data/lib/expressir/express/model_visitor.rb +24 -0
  34. data/lib/expressir/express/parser.rb +84 -0
  35. data/lib/expressir/express/resolve_references_model_visitor.rb +31 -0
  36. data/lib/expressir/express/schema_head_formatter.rb +23 -0
  37. data/lib/expressir/express/visitor.rb +2588 -0
  38. data/lib/expressir/model/cache.rb +17 -0
  39. data/lib/expressir/model/data_type.rb +9 -0
  40. data/lib/expressir/model/data_types/aggregate.rb +31 -0
  41. data/lib/expressir/model/data_types/array.rb +31 -0
  42. data/lib/expressir/model/data_types/bag.rb +25 -0
  43. data/lib/expressir/model/data_types/binary.rb +22 -0
  44. data/lib/expressir/model/data_types/boolean.rb +10 -0
  45. data/lib/expressir/model/data_types/enumeration.rb +25 -0
  46. data/lib/expressir/model/data_types/enumeration_item.rb +26 -0
  47. data/lib/expressir/model/data_types/generic.rb +26 -0
  48. data/lib/expressir/model/data_types/generic_entity.rb +26 -0
  49. data/lib/expressir/model/data_types/integer.rb +10 -0
  50. data/lib/expressir/model/data_types/list.rb +28 -0
  51. data/lib/expressir/model/data_types/logical.rb +10 -0
  52. data/lib/expressir/model/data_types/number.rb +10 -0
  53. data/lib/expressir/model/data_types/real.rb +19 -0
  54. data/lib/expressir/model/data_types/select.rb +28 -0
  55. data/lib/expressir/model/data_types/set.rb +25 -0
  56. data/lib/expressir/model/data_types/string.rb +22 -0
  57. data/lib/expressir/model/declaration.rb +9 -0
  58. data/lib/expressir/model/declarations/attribute.rb +47 -0
  59. data/lib/expressir/model/declarations/constant.rb +34 -0
  60. data/lib/expressir/model/declarations/entity.rb +53 -0
  61. data/lib/expressir/model/declarations/function.rb +67 -0
  62. data/lib/expressir/model/declarations/interface.rb +28 -0
  63. data/lib/expressir/model/declarations/interface_item.rb +23 -0
  64. data/lib/expressir/model/declarations/interfaced_item.rb +37 -0
  65. data/lib/expressir/model/declarations/parameter.rb +34 -0
  66. data/lib/expressir/model/declarations/procedure.rb +64 -0
  67. data/lib/expressir/model/declarations/remark_item.rb +21 -0
  68. data/lib/expressir/model/declarations/rule.rb +71 -0
  69. data/lib/expressir/model/declarations/schema.rb +117 -0
  70. data/lib/expressir/model/declarations/schema_version.rb +22 -0
  71. data/lib/expressir/model/declarations/schema_version_item.rb +22 -0
  72. data/lib/expressir/model/declarations/subtype_constraint.rb +40 -0
  73. data/lib/expressir/model/declarations/type.rb +45 -0
  74. data/lib/expressir/model/declarations/unique_rule.rb +31 -0
  75. data/lib/expressir/model/declarations/variable.rb +34 -0
  76. data/lib/expressir/model/declarations/where_rule.rb +31 -0
  77. data/lib/expressir/model/expression.rb +9 -0
  78. data/lib/expressir/model/expressions/aggregate_initializer.rb +19 -0
  79. data/lib/expressir/model/expressions/aggregate_initializer_item.rb +22 -0
  80. data/lib/expressir/model/expressions/binary_expression.rb +53 -0
  81. data/lib/expressir/model/expressions/entity_constructor.rb +22 -0
  82. data/lib/expressir/model/expressions/function_call.rb +22 -0
  83. data/lib/expressir/model/expressions/interval.rb +34 -0
  84. data/lib/expressir/model/expressions/query_expression.rb +35 -0
  85. data/lib/expressir/model/expressions/unary_expression.rb +27 -0
  86. data/lib/expressir/model/identifier.rb +34 -0
  87. data/lib/expressir/model/literal.rb +9 -0
  88. data/lib/expressir/model/literals/binary.rb +19 -0
  89. data/lib/expressir/model/literals/integer.rb +19 -0
  90. data/lib/expressir/model/literals/logical.rb +23 -0
  91. data/lib/expressir/model/literals/real.rb +19 -0
  92. data/lib/expressir/model/literals/string.rb +22 -0
  93. data/lib/expressir/model/model_element.rb +208 -0
  94. data/lib/expressir/model/reference.rb +9 -0
  95. data/lib/expressir/model/references/attribute_reference.rb +22 -0
  96. data/lib/expressir/model/references/group_reference.rb +22 -0
  97. data/lib/expressir/model/references/index_reference.rb +27 -0
  98. data/lib/expressir/model/references/simple_reference.rb +24 -0
  99. data/lib/expressir/model/repository.rb +23 -0
  100. data/lib/expressir/model/statement.rb +9 -0
  101. data/lib/expressir/model/statements/alias.rb +35 -0
  102. data/lib/expressir/model/statements/assignment.rb +22 -0
  103. data/lib/expressir/model/statements/case.rb +25 -0
  104. data/lib/expressir/model/statements/case_action.rb +22 -0
  105. data/lib/expressir/model/statements/compound.rb +19 -0
  106. data/lib/expressir/model/statements/escape.rb +10 -0
  107. data/lib/expressir/model/statements/if.rb +25 -0
  108. data/lib/expressir/model/statements/null.rb +10 -0
  109. data/lib/expressir/model/statements/procedure_call.rb +22 -0
  110. data/lib/expressir/model/statements/repeat.rb +47 -0
  111. data/lib/expressir/model/statements/return.rb +19 -0
  112. data/lib/expressir/model/statements/skip.rb +10 -0
  113. data/lib/expressir/model/supertype_expression.rb +9 -0
  114. data/lib/expressir/model/supertype_expressions/binary_supertype_expression.rb +29 -0
  115. data/lib/expressir/model/supertype_expressions/oneof_supertype_expression.rb +19 -0
  116. data/lib/expressir/model.rb +79 -0
  117. data/lib/expressir/version.rb +3 -0
  118. data/lib/expressir.rb +24 -0
  119. data/rakelib/antlr4-native.rake +161 -0
  120. data/rakelib/cross-ruby.rake +384 -0
  121. data/spec/acceptance/version_spec.rb +27 -0
  122. data/spec/expressir/express/cache_spec.rb +89 -0
  123. data/spec/expressir/express/formatter_spec.rb +173 -0
  124. data/spec/expressir/express/parser_spec.rb +141 -0
  125. data/spec/expressir/model/model_element_spec.rb +318 -0
  126. data/spec/spec_helper.rb +24 -0
  127. data/spec/support/console_helper.rb +29 -0
  128. data/spec/syntax/multiple.exp +23 -0
  129. data/spec/syntax/multiple.yaml +198 -0
  130. data/spec/syntax/multiple_formatted.exp +71 -0
  131. data/spec/syntax/multiple_hyperlink_formatted.exp +71 -0
  132. data/spec/syntax/multiple_schema_head_hyperlink_formatted.exp +13 -0
  133. data/spec/syntax/remark.exp +193 -0
  134. data/spec/syntax/remark.yaml +471 -0
  135. data/spec/syntax/remark_formatted.exp +228 -0
  136. data/spec/syntax/single.exp +4 -0
  137. data/spec/syntax/single.yaml +18 -0
  138. data/spec/syntax/single_formatted.exp +10 -0
  139. data/spec/syntax/single_formatted.yaml +36 -0
  140. data/spec/syntax/syntax.exp +333 -0
  141. data/spec/syntax/syntax.yaml +3509 -0
  142. data/spec/syntax/syntax_formatted.exp +902 -0
  143. data/spec/syntax/syntax_hyperlink_formatted.exp +902 -0
  144. data/spec/syntax/syntax_schema_head_formatted.exp +18 -0
  145. metadata +390 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 3d7525074aac8d35650eb724a90f2adf4e3f1072e5be6a445bfb3ac9acf416d0
4
+ data.tar.gz: f0bd6140c6616c3f1ef2f65477d7583c55bd78da8f3dc7692e87091cc305df7d
5
+ SHA512:
6
+ metadata.gz: 49cea640e6730e38060c6fdb81ff2ddea786c559b8a0ef443868965914c8a95027c6e6c9ae626585e8508fb74f5ecd971cc1af4f7046c7e82557fd2d41e146ec
7
+ data.tar.gz: 74b5f350b0aa9f95213fcadf5026b6ace47ceb0ee28fb0a855af73f695f21c79614b3af63e2bf2d4f7cb11988d321e50e49ea05a40ea1fafb7af98db4a7b414d
data/.cross_rubies ADDED
@@ -0,0 +1,20 @@
1
+ 3.2.0:x86_64-w64-mingw32
2
+ 3.2.0:x86_64-linux-gnu
3
+ 3.2.0:aarch64-linux-gnu
4
+ 3.2.0:x86_64-darwin
5
+ 3.2.0:arm64-darwin
6
+ 3.1.0:x86_64-w64-mingw32
7
+ 3.1.0:x86_64-linux-gnu
8
+ 3.1.0:aarch64-linux-gnu
9
+ 3.1.0:x86_64-darwin
10
+ 3.1.0:arm64-darwin
11
+ 3.0.0:x86_64-w64-mingw32
12
+ 3.0.0:x86_64-linux-gnu
13
+ 3.0.0:aarch64-linux-gnu
14
+ 3.0.0:x86_64-darwin
15
+ 3.0.0:arm64-darwin
16
+ 2.7.0:x86_64-w64-mingw32
17
+ 2.7.0:x86_64-linux-gnu
18
+ 2.7.0:aarch64-linux-gnu
19
+ 2.7.0:x86_64-darwin
20
+ 2.7.0:arm64-darwin
@@ -0,0 +1,313 @@
1
+ name: rake
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ paths-ignore:
7
+ - 'docs/**'
8
+ - '**.adoc'
9
+ - '**.md'
10
+ - .github/workflows/release.yml
11
+ pull_request:
12
+ workflow_dispatch:
13
+
14
+ concurrency:
15
+ group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}'
16
+ cancel-in-progress: true
17
+
18
+ env:
19
+ BUNDLER_VER: 2.4.22
20
+ # Forcing bundler version to ensure that it is consistent everywhere and
21
+ # does not cause bundler gem reinstalls
22
+ # bundler/rubygems 2.3.22 is a minimal requirement to support gnu/musl differentiation
23
+ # https://github.com/rubygems/rubygems/pull/4488
24
+
25
+ jobs:
26
+ rubocop:
27
+ runs-on: ubuntu-latest
28
+ steps:
29
+ - name: Checkout
30
+ uses: actions/checkout@v4
31
+ with:
32
+ submodules: recursive
33
+
34
+ - name: Install Ruby
35
+ uses: ruby/setup-ruby@master
36
+ with:
37
+ ruby-version: 3.1
38
+ bundler: ${{ env.BUNDLER_VER }}
39
+ bundler-cache: true
40
+
41
+ - name: Bundle
42
+ run: bundle install --jobs 4 --retry 3
43
+
44
+ - name: Rubocop
45
+ run: bundle exec rake rubocop
46
+
47
+ rake:
48
+ name: test on ruby-${{ matrix.ruby }} ${{ matrix.os }}
49
+ runs-on: ${{ matrix.os }}
50
+ strategy:
51
+ fail-fast: false
52
+ matrix:
53
+ ruby: [ '3.2', '3.1', '3.0', '2.7' ]
54
+ os: [ ubuntu-latest, windows-latest, macos-latest ]
55
+
56
+ steps:
57
+ - name: Checkout
58
+ uses: actions/checkout@v4
59
+ with:
60
+ submodules: recursive
61
+
62
+ - name: Setup packages
63
+ if: startsWith(matrix.os, 'macos')
64
+ run: brew install autoconf automake libtool
65
+
66
+ - name: Install Ruby
67
+ uses: ruby/setup-ruby@master
68
+ with:
69
+ ruby-version: ${{ matrix.ruby }}
70
+ bundler: ${{ env.BUNDLER_VER }}
71
+ # Rice gem has issues with bundler cache
72
+ # more info https://github.com/lutaml/expressir/runs/2097658383?check_suite_focus=true#step:7:2126
73
+ # but it is not the only issue
74
+ bundler-cache: false
75
+
76
+ - name: Bundle
77
+ run: bundle install --jobs 4 --retry 3
78
+
79
+ - name: Process cache
80
+ uses: actions/cache@v3
81
+ id: cache
82
+ with:
83
+ path: lib/expressir/express/express_parser.*
84
+ key: v4-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('ext/express-parser/extconf.rb', 'ext/express-parser/antlrgen/**', 'ext/express-parser/express_parser.cpp', '.git/modules/ext/express-parser/antlr4-upstream/HEAD') }}
85
+
86
+ - name: Build native extension
87
+ if: steps.cache.outputs.cache-hit != 'true'
88
+ run: bundle exec rake compile
89
+
90
+ - name: Run tests
91
+ run: |
92
+ bundle exec rake
93
+ cat .rspec_status
94
+
95
+ # test release workflow
96
+ pack-ruby:
97
+ runs-on: ubuntu-latest
98
+ steps:
99
+ - name: Checkout
100
+ uses: actions/checkout@v4
101
+ with:
102
+ submodules: recursive
103
+
104
+ - name: Setup Ruby
105
+ uses: ruby/setup-ruby@master
106
+ with:
107
+ ruby-version: '3.1'
108
+ bundler: ${{ env.BUNDLER_VER }}
109
+ bundler-cache: false
110
+
111
+ - name: Bundle
112
+ run: bundle install --jobs 4 --retry 3
113
+
114
+ - name: Build gem without native extension
115
+ run: gem build expressir.gemspec
116
+
117
+ - name: Package gem without native extension
118
+ uses: actions/upload-artifact@v3
119
+ with:
120
+ name: pkg-ruby
121
+ path: expressir-*.gem
122
+
123
+ pack:
124
+ runs-on: ubuntu-latest
125
+ strategy:
126
+ fail-fast: false
127
+ matrix:
128
+ platform: [ linux-gnu, windows, darwin ]
129
+ steps:
130
+ - name: Checkout
131
+ uses: actions/checkout@v4
132
+ with:
133
+ submodules: recursive
134
+
135
+ - name: Setup Ruby
136
+ uses: ruby/setup-ruby@master
137
+ with:
138
+ ruby-version: '3.1'
139
+ bundler-cache: false
140
+ bundler: ${{ env.BUNDLER_VER }}
141
+
142
+ - name: Bundle
143
+ run: bundle install --jobs 4 --retry 3
144
+
145
+ - name: Enable swap
146
+ run: |
147
+ sudo fallocate -l 15g /compile.swap
148
+ sudo chmod 600 /compile.swap
149
+ sudo mkswap /compile.swap
150
+ sudo swapon /compile.swap
151
+ sudo swapon --all --verbose
152
+
153
+ - name: Build gem with native extension
154
+ run: bundle exec rake gem:${{ matrix.platform }}
155
+
156
+ - name: Package gem with native extension
157
+ uses: actions/upload-artifact@v3
158
+ with:
159
+ name: pkg-${{ matrix.platform }}
160
+ path: pkg/*.gem
161
+
162
+ verify-ruby:
163
+ name: verify ruby gem on ruby-${{ matrix.ruby }} ${{ matrix.os }}
164
+ needs: pack-ruby
165
+ runs-on: ${{ matrix.os }}
166
+ strategy:
167
+ fail-fast: false
168
+ matrix:
169
+ ruby: [ '3.2', '3.1', '3.0', '2.7' ]
170
+ os: [ ubuntu-latest, windows-latest, macos-latest ]
171
+ steps:
172
+ - name: Install Ruby
173
+ uses: ruby/setup-ruby@master
174
+ with:
175
+ ruby-version: ${{ matrix.ruby }}
176
+ bundler-cache: false
177
+ bundler: ${{ env.BUNDLER_VER }}
178
+
179
+ - name: Checkout
180
+ uses: actions/checkout@v4
181
+ with:
182
+ submodules: recursive
183
+
184
+ - name: Bundle
185
+ run: bundle install --jobs 4 --retry 3
186
+
187
+ - name: Download packaged gem
188
+ uses: actions/download-artifact@v3
189
+ with:
190
+ name: pkg-ruby
191
+ path: pkg
192
+
193
+ - name: Install gem
194
+ run: gem install -l pkg/expressir-*.gem
195
+
196
+ - name: Verify
197
+ run: |
198
+ cd $(ruby -e "puts RbConfig::TOPDIR + '\/lib\/ruby\/gems\/' + RbConfig::CONFIG['ruby_version'] + '\/gems\/expressir*'")
199
+ ruby bin/rspec
200
+ cat .rspec_status || echo ".rspec_status was not found"
201
+
202
+ verify-darwin:
203
+ name: verify MacOS binary gem on ruby-${{ matrix.ruby }}
204
+ needs: pack
205
+ runs-on: macos-latest
206
+ strategy:
207
+ fail-fast: false
208
+ matrix:
209
+ ruby: [ '3.2', '3.1', '3.0', '2.7' ]
210
+ steps:
211
+ - name: Install Ruby
212
+ uses: ruby/setup-ruby@master
213
+ with:
214
+ ruby-version: ${{ matrix.ruby }}
215
+ bundler-cache: false
216
+ bundler: ${{ env.BUNDLER_VER }}
217
+
218
+ - name: Checkout
219
+ uses: actions/checkout@v4
220
+
221
+ - name: Bundle
222
+ run: bundle install --jobs 4 --retry 3
223
+
224
+ - name: Download packaged gem
225
+ uses: actions/download-artifact@v3
226
+ with:
227
+ name: pkg-darwin
228
+ path: pkg
229
+
230
+ - name: Install binary gem
231
+ run: gem install -l pkg/expressir-*-$(ruby -e "puts RUBY_PLATFORM.sub(/darwin\d{2}$/, 'darwin')").gem
232
+ # MacOS with have something like x86_64-darwin19, others just x86_64-linux
233
+
234
+ - name: Verify
235
+ run: |
236
+ cd $(ruby -e "puts RbConfig::TOPDIR + '\/lib\/ruby\/gems\/' + RbConfig::CONFIG['ruby_version'] + '\/gems\/expressir*'")
237
+ ruby bin/rspec
238
+ cat .rspec_status || echo ".rspec_status was not found"
239
+
240
+ verify-linux-gnu:
241
+ name: verify Linux (gnu) binary gem on ruby-${{ matrix.ruby }}
242
+ needs: pack
243
+ runs-on: ubuntu-latest
244
+ strategy:
245
+ fail-fast: false
246
+ matrix:
247
+ ruby: [ '3.2', '3.1', '3.0', '2.7' ]
248
+ steps:
249
+ - name: Install Ruby
250
+ uses: ruby/setup-ruby@master
251
+ with:
252
+ ruby-version: ${{ matrix.ruby }}
253
+ bundler-cache: false
254
+ bundler: ${{ env.BUNDLER_VER }}
255
+
256
+ - name: Checkout
257
+ uses: actions/checkout@v4
258
+
259
+ - name: Bundle
260
+ run: bundle install --jobs 4 --retry 3
261
+
262
+ - name: Download packaged gem
263
+ uses: actions/download-artifact@v3
264
+ with:
265
+ name: pkg-linux-gnu
266
+ path: pkg
267
+
268
+ - name: Install binary gem
269
+ run: gem install -l pkg/expressir-*-$(ruby -e "puts RUBY_PLATFORM")-gnu.gem
270
+
271
+ - name: Verify
272
+ run: |
273
+ cd $(ruby -e "puts RbConfig::TOPDIR + '\/lib\/ruby\/gems\/' + RbConfig::CONFIG['ruby_version'] + '\/gems\/expressir*'")
274
+ ruby bin/rspec
275
+ cat .rspec_status || echo ".rspec_status was not found"
276
+
277
+ verify-windows:
278
+ name: verify Windows binary gem on ruby-${{ matrix.ruby }}
279
+ needs: pack
280
+ continue-on-error: true
281
+ runs-on: windows-latest
282
+ strategy:
283
+ fail-fast: false
284
+ matrix:
285
+ ruby: [ '3.2', '3.1', '3.0', '2.7' ]
286
+ steps:
287
+ - name: Install Ruby
288
+ uses: ruby/setup-ruby@master
289
+ with:
290
+ ruby-version: ${{ matrix.ruby }}
291
+ bundler-cache: false
292
+ bundler: ${{ env.BUNDLER_VER }}
293
+
294
+ - name: Checkout
295
+ uses: actions/checkout@v4
296
+
297
+ - name: Bundle
298
+ run: bundle install --jobs 4 --retry 3
299
+
300
+ - name: Download packaged gem
301
+ uses: actions/download-artifact@v3
302
+ with:
303
+ name: pkg-windows
304
+ path: pkg
305
+
306
+ - name: Install binary gem
307
+ run: gem install -l pkg/expressir-*-$(ruby -e "puts RUBY_PLATFORM").gem
308
+
309
+ - name: Verify
310
+ run: |
311
+ cd $(ruby -e "puts RbConfig::TOPDIR + '\/lib\/ruby\/gems\/' + RbConfig::CONFIG['ruby_version'] + '\/gems\/expressir*'")
312
+ ruby bin/rspec
313
+ cat .rspec_status || echo ".rspec_status was not found"
@@ -0,0 +1,181 @@
1
+ name: release
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ next_version:
7
+ description: |
8
+ Next release version. Possible values: x.y.z, major, minor, patch or pre|rc|etc
9
+ required: true
10
+ default: 'patch'
11
+ push:
12
+ tags: [ v* ]
13
+
14
+ concurrency:
15
+ group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}'
16
+ cancel-in-progress: true
17
+
18
+ jobs:
19
+ bump:
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+ with:
24
+ submodules: recursive
25
+
26
+ - uses: ruby/setup-ruby@master
27
+ with:
28
+ ruby-version: '3.1'
29
+ bundler: ${{ env.BUNDLER_VER }}
30
+
31
+ - if: ${{ github.event_name == 'workflow_dispatch' }} # unfortunatelly cannot keep this condition on job level
32
+ run: |
33
+ git config --global user.name github-actions
34
+ git config --global user.email github-actions@github.com
35
+ gem install gem-release
36
+ gem bump --version ${{ github.event.inputs.next_version }} --tag --push
37
+
38
+ pack:
39
+ runs-on: ubuntu-latest
40
+ needs: bump
41
+ strategy:
42
+ fail-fast: false
43
+ matrix:
44
+ platform: [ linux-gnu, windows, darwin ]
45
+ steps:
46
+ - uses: actions/checkout@v4
47
+ with:
48
+ submodules: recursive
49
+ ref: main # https://github.com/actions/checkout/issues/439#issuecomment-830862188
50
+
51
+ - uses: ruby/setup-ruby@master
52
+ with:
53
+ ruby-version: '3.1'
54
+ # bundler-cache: true important to not use cache because it leads to "cannot find -lrice"
55
+ # more info https://github.com/lutaml/expressir/runs/2097658383?check_suite_focus=true#step:7:2126
56
+
57
+ - run: bundle install --jobs 4 --retry 3
58
+
59
+ - name: Build gem and save version
60
+ if: matrix.platform == 'linux-gnu'
61
+ run: |
62
+ gem build expressir.gemspec | grep -o 'Version: .*' | awk '{print $2}' > version
63
+
64
+ - if: matrix.platform == 'linux-gnu'
65
+ uses: actions/upload-artifact@v3
66
+ with:
67
+ name: pkg-ruby
68
+ path: expressir-*.gem
69
+
70
+ - if: matrix.platform == 'linux-gnu'
71
+ uses: actions/upload-artifact@v3
72
+ with:
73
+ name: version
74
+ path: version
75
+
76
+ - name: Enable swap
77
+ run: |
78
+ sudo fallocate -l 15g /compile.swap
79
+ sudo chmod 600 /compile.swap
80
+ sudo mkswap /compile.swap
81
+ sudo swapon /compile.swap
82
+ sudo swapon --all --verbose
83
+
84
+ # build gem WITH pre-built native extension
85
+ - run: bundle exec rake gem:${{ matrix.platform }}
86
+
87
+ - uses: actions/upload-artifact@v3
88
+ with:
89
+ name: pkg-${{ matrix.platform }}
90
+ path: pkg/*.gem
91
+
92
+ publish:
93
+ runs-on: ubuntu-latest
94
+ needs: pack
95
+ steps:
96
+ - uses: actions/download-artifact@v3
97
+ with:
98
+ name: pkg-ruby
99
+ path: pkg
100
+
101
+ - uses: actions/download-artifact@v3
102
+ with:
103
+ name: pkg-linux-gnu
104
+ path: pkg
105
+
106
+ - uses: actions/download-artifact@v3
107
+ with:
108
+ name: pkg-windows
109
+ path: pkg
110
+
111
+ - uses: actions/download-artifact@v3
112
+ with:
113
+ name: pkg-darwin
114
+ path: pkg
115
+
116
+ - uses: ruby/setup-ruby@master
117
+ with:
118
+ ruby-version: '3.1'
119
+
120
+ - name: Publish to rubygems.org
121
+ env:
122
+ RUBYGEMS_API_KEY: ${{ secrets.LUTAML_CI_RUBYGEMS_API_KEY }}
123
+ run: |
124
+ ls -l pkg/
125
+ mkdir -p ~/.gem
126
+ cat > ~/.gem/credentials << EOF
127
+ ---
128
+ :rubygems_api_key: ${RUBYGEMS_API_KEY}
129
+ EOF
130
+ chmod 0600 ~/.gem/credentials
131
+ gem signin
132
+ for gem in pkg/*.gem; do gem push $gem -V; done
133
+ sleep(5)
134
+
135
+ verify:
136
+ name: Verify published gem on ${{ matrix.os }}
137
+ needs: publish
138
+ runs-on: ${{ matrix.os }}
139
+ strategy:
140
+ fail-fast: false
141
+ matrix:
142
+ os: [ ubuntu-latest, windows-latest, macos-latest ]
143
+ steps:
144
+ - name: Install Ruby
145
+ uses: ruby/setup-ruby@master
146
+ with:
147
+ ruby-version: 3.1
148
+ bundler-cache: true
149
+ bundler: ${{ env.BUNDLER_VER }}
150
+
151
+ - name: Download version
152
+ uses: actions/download-artifact@v3
153
+ with:
154
+ name: version
155
+
156
+ - name: Install gem
157
+ run: gem install expressir -v $(cat version)
158
+
159
+ - name: Verify
160
+ run: expressir version
161
+
162
+ verify-alpine:
163
+ name: Verify published gem on alpine
164
+ needs: publish
165
+ runs-on: ubuntu-latest
166
+ container:
167
+ image: alpine:3.17
168
+ steps:
169
+ - name: Install packages
170
+ run: apk --no-cache add bash build-base git ruby-dev gcc g++ automake
171
+
172
+ - name: Download version
173
+ uses: actions/download-artifact@v3
174
+ with:
175
+ name: version
176
+
177
+ - name: Install gem
178
+ run: gem install expressir -v $(cat version)
179
+
180
+ - name: Verify
181
+ run: expressir version
data/.gitignore ADDED
@@ -0,0 +1,23 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ /Gemfile.lock
10
+ /.idea
11
+ /.vscode
12
+ /lib/expressir/express/express_parser.bundle
13
+ /lib/expressir/express/express_parser.so
14
+ /lib/expressir/express/*/express_parser.bundle
15
+ /lib/expressir/express/*/express_parser.so
16
+ /spec/syntax/*-pretty.exp
17
+ /ext/express-parser/rice-embed
18
+
19
+ # rspec failure tracking
20
+ .rspec_status
21
+
22
+ # rubocop guide
23
+ .rubocop-https---*
data/.gitmodules ADDED
@@ -0,0 +1,6 @@
1
+ [submodule "ext/express-parser/antlr4-upstream"]
2
+ path = ext/express-parser/antlr4-upstream
3
+ url = https://github.com/antlr/antlr4
4
+ [submodule "ext/express-grammar"]
5
+ path = ext/express-grammar
6
+ url = https://github.com/lutaml/express-grammar
data/.hound.yml ADDED
@@ -0,0 +1,3 @@
1
+ ruby:
2
+ enabled: true
3
+ config_file: .rubocop.yml
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,18 @@
1
+ inherit_from:
2
+ - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
3
+
4
+ AllCops:
5
+ TargetRubyVersion: 2.7
6
+ NewCops: enable
7
+ SuggestExtensions: false
8
+ Exclude:
9
+ - 'vendor/**/*'
10
+ - 'expressir.gemspec'
11
+ - 'tmp/**/*'
12
+ - 'pkg/**/*'
13
+ - 'exe/format-test'
14
+ - 'lib/expressir/express/**/*'
15
+ - 'lib/expressir/model/**/*'
16
+
17
+ Layout/LineLength:
18
+ Max: 160
data/.yardopts ADDED
@@ -0,0 +1,11 @@
1
+ # macro must be defined first, see https://stackoverflow.com/a/10344776/1823988
2
+ lib/expressir/model/model_element.rb
3
+ lib/expressir/model/data_type.rb
4
+ lib/expressir/model/declaration.rb
5
+ lib/expressir/model/expression.rb
6
+ lib/expressir/model/literal.rb
7
+ lib/expressir/model/reference.rb
8
+ lib/expressir/model/statement.rb
9
+ lib/expressir/model/supertype_expression.rb
10
+
11
+ lib/**/*.rb
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in reeper.gemspec
4
+ gemspec