File tree 6 files changed +78
-1398
lines changed 6 files changed +78
-1398
lines changed Original file line number Diff line number Diff line change
1
+ name : CI
2
+
3
+ on :
4
+ push :
5
+ branches : [main]
6
+ paths :
7
+ - grammar.js
8
+ - src/**
9
+ - test/**
10
+ - bindings/**
11
+ - binding.gyp
12
+ - test_on_cpp2_files.sh
13
+ pull_request :
14
+ paths :
15
+ - grammar.js
16
+ - src/**
17
+ - test/**
18
+ - bindings/**
19
+ - binding.gyp
20
+ - test_on_cpp2_files.sh
21
+
22
+ concurrency :
23
+ group : ${{github.workflow}}-${{github.ref}}
24
+ cancel-in-progress : true
25
+
26
+ jobs :
27
+ test :
28
+ name : Test parser
29
+ runs-on : ${{matrix.os}}
30
+ strategy :
31
+ fail-fast : false
32
+ matrix :
33
+ os : [ubuntu-latest]
34
+ steps :
35
+ - name : Checkout repository
36
+ uses : actions/checkout@v4
37
+ - name : Checkout tree-sitter-c
38
+ uses : actions/checkout@v4
39
+ with :
40
+ repository : tree-sitter/tree-sitter-c
41
+ path : node_modules/tree-sitter-c
42
+ sparse-checkout : queries/
43
+ ref : v0.21.4
44
+ - name : Checkout tree-sitter-cpp
45
+ uses : actions/checkout@v4
46
+ with :
47
+ repository : tree-sitter/tree-sitter-cpp
48
+ path : node_modules/tree-sitter-cpp
49
+ sparse-checkout : queries/
50
+ ref : v0.22.3
51
+ - name : Set up tree-sitter
52
+ uses : tree-sitter/setup-action/cli@v1
53
+ - name : Run tests
54
+ uses : tree-sitter/parser-test-action@v2
55
+ with :
56
+ test-rust : ${{runner.os == 'Linux'}}
57
+ test-node : true
58
+ test-python : true
59
+ test-go : true
60
+ - name : Clone cppfront
61
+ run : git clone https://github.com/hsutter/cppfront.git
62
+ - name : Find and parse cpp2 files
63
+ run : ./test_on_cpp2_files.sh ./cppfront
Original file line number Diff line number Diff line change 42
42
example-file.txt
43
43
log.html
44
44
cppfront
45
+ cpp2_files.txt
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
set -e
3
3
4
- echo " Generating parser ..."
5
- tree-sitter generate
6
- echo " Done"
7
-
8
4
# Directory to search
9
5
search_dir=" $1 "
10
6
echo " Looking for files in \" ${search_dir} \" "
@@ -25,9 +21,21 @@ for pattern in "${exclude_patterns[@]}"; do
25
21
find_command+=" ! -name \" $pattern \" "
26
22
done
27
23
28
- find_command=" $find_command -exec sh -c 'tree-sitter parse -q " \$ 1" || exit 255' _ {} \;"
24
+ if [ -f cpp2_files.txt ]; then
25
+ echo " Aborting: 'cpp2_files.txt' already exists"
26
+ exit 1
27
+ fi
28
+
29
+ # find_command="$find_command -exec sh -c 'tree-sitter parse -q "\$1" || exit 255' _ {} \;"
29
30
echo " Command: " $find_command
30
- eval $find_command
31
+ eval $find_command > cpp2_files.txt
32
+
33
+ while IFS= read -r file; do
34
+ echo " Parsing '$file '"
35
+ tree-sitter parse -q " $file "
36
+ done < cpp2_files.txt
37
+
38
+ rm cpp2_files.txt
31
39
32
40
echo " Done"
33
41
You can’t perform that action at this time.
0 commit comments