-
Notifications
You must be signed in to change notification settings - Fork 2
63 lines (60 loc) · 1.93 KB
/
Copy pathtest.yml
File metadata and controls
63 lines (60 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: test
on:
push:
branches: [ main, v* ]
pull_request:
workflow_dispatch:
jobs:
isc-parse:
name: All .isc files parse (Ruby)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
- name: Checkout interscript-ruby
run: |
git clone --depth=1 https://github.com/interscript/interscript-ruby.git ../interscript
- name: Install parser dependency
run: gem install parslet
- name: Parse all .isc files
run: |
cd ../interscript
ruby -Ilib -e '
require "interscript"
require "interscript/isc"
total = 0
failures = []
Dir.glob("../maps/maps/*.isc").sort.each do |path|
total += 1
begin
tree = Interscript::Isc::Parser.parse(File.read(path), filename: File.basename(path))
Interscript::Isc::DocumentBuilder.build(tree, filename: File.basename(path))
rescue => e
failures << "#{File.basename(path)}: #{e.message[0,120]}"
end
end
puts "Parsed #{total - failures.size}/#{total} .isc files"
failures.each { |f| STDERR.puts " #{f}" }
exit 1 if failures.any?
'
isc-parse-ts:
name: All .isc files parse (TS)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Checkout interscript-ts
run: |
git clone --depth=1 --branch main https://github.com/interscript/interscript-ts.git ../interscript-ts
- uses: actions/setup-node@v7
with:
node-version: "22"
- name: Install + build TS parser
run: |
cd ../interscript-ts
npm ci
npm run build
- name: Parse all .isc files
run: npx -y tsx scripts/parse-isc.mjs ../interscript-ts