@@ -55,35 +55,35 @@ jobs:
55
55
id : cache-extractor
56
56
with :
57
57
path : |
58
- ruby/target/release/ruby- autobuilder
59
- ruby/target/release/ruby- autobuilder.exe
60
- ruby/target/release/ruby- extractor
61
- ruby/target/release/ruby- extractor.exe
62
- ruby/ql/lib/codeql/ruby/ast/internal/TreeSitter.qll
63
- key : ${{ runner.os }}-${{ steps.os_version.outputs.version }}-ruby-extractor-${{ hashFiles('ruby/rust-toolchain.toml', 'ruby/** /Cargo.lock') }}--${{ hashFiles('ruby/**/*.rs') }}
58
+ ruby/extractor/ target/release/autobuilder
59
+ ruby/extractor/ target/release/autobuilder.exe
60
+ ruby/extractor/ target/release/extractor
61
+ ruby/extractor/ target/release/extractor.exe
62
+ ruby/extractor/ ql/lib/codeql/ruby/ast/internal/TreeSitter.qll
63
+ key : ${{ runner.os }}-${{ steps.os_version.outputs.version }}-ruby-extractor-${{ hashFiles('ruby/extractor/ rust-toolchain.toml', 'ruby/extractor /Cargo.lock') }}--${{ hashFiles('ruby/extractor /**/*.rs') }}
64
64
- uses : actions/cache@v3
65
65
if : steps.cache-extractor.outputs.cache-hit != 'true'
66
66
with :
67
67
path : |
68
68
~/.cargo/registry
69
69
~/.cargo/git
70
70
ruby/target
71
- key : ${{ runner.os }}-${{ steps.os_version.outputs.version }}-ruby-rust-cargo-${{ hashFiles('ruby/rust-toolchain.toml', 'ruby/**/Cargo.lock') }}
71
+ key : ${{ runner.os }}-${{ steps.os_version.outputs.version }}-ruby-rust-cargo-${{ hashFiles('ruby/extractor/ rust-toolchain.toml', 'ruby/extractor /**/Cargo.lock') }}
72
72
- name : Check formatting
73
73
if : steps.cache-extractor.outputs.cache-hit != 'true'
74
- run : cargo fmt --all -- --check
74
+ run : cd extractor && cargo fmt --all -- --check
75
75
- name : Build
76
76
if : steps.cache-extractor.outputs.cache-hit != 'true'
77
- run : cargo build --verbose
77
+ run : cd extractor && cargo build --verbose
78
78
- name : Run tests
79
79
if : steps.cache-extractor.outputs.cache-hit != 'true'
80
- run : cargo test --verbose
80
+ run : cd extractor && cargo test --verbose
81
81
- name : Release build
82
82
if : steps.cache-extractor.outputs.cache-hit != 'true'
83
- run : cargo build --release
83
+ run : cd extractor && cargo build --release
84
84
- name : Generate dbscheme
85
85
if : ${{ matrix.os == 'ubuntu-latest' && steps.cache-extractor.outputs.cache-hit != 'true'}}
86
- run : target/release/ruby- generator --dbscheme ql/lib/ruby.dbscheme --library ql/lib/codeql/ruby/ast/internal/TreeSitter.qll
86
+ run : extractor/ target/release/generator --dbscheme ql/lib/ruby.dbscheme --library ql/lib/codeql/ruby/ast/internal/TreeSitter.qll
87
87
- uses : actions/upload-artifact@v3
88
88
if : ${{ matrix.os == 'ubuntu-latest' }}
89
89
with :
@@ -98,10 +98,10 @@ jobs:
98
98
with :
99
99
name : extractor-${{ matrix.os }}
100
100
path : |
101
- ruby/target/release/ruby- autobuilder
102
- ruby/target/release/ruby- autobuilder.exe
103
- ruby/target/release/ruby- extractor
104
- ruby/target/release/ruby- extractor.exe
101
+ ruby/extractor/ target/release/autobuilder
102
+ ruby/extractor/ target/release/autobuilder.exe
103
+ ruby/extractor/ target/release/extractor
104
+ ruby/extractor/ target/release/extractor.exe
105
105
retention-days : 1
106
106
compile-queries :
107
107
runs-on : ubuntu-latest-xl
@@ -116,21 +116,22 @@ jobs:
116
116
key : ruby-build
117
117
- name : Build Query Pack
118
118
run : |
119
- rm -rf target/packs
120
- codeql pack create ../misc/suite-helpers --output target/packs
121
- codeql pack create ../shared/regex --output target/packs
122
- codeql pack create ../shared/ssa --output target/packs
123
- codeql pack create ../shared/tutorial --output target/packs
124
- codeql pack create ql/lib --output target/packs
125
- codeql pack create -j0 ql/src --output target/packs --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}"
126
- PACK_FOLDER=$(readlink -f target/packs/codeql/ruby-queries/*)
119
+ PACKS=${{ runner.temp }}/query-packs
120
+ rm -rf $PACKS
121
+ codeql pack create ../misc/suite-helpers --output "$PACKS"
122
+ codeql pack create ../shared/regex --output "$PACKS"
123
+ codeql pack create ../shared/ssa --output "$PACKS"
124
+ codeql pack create ../shared/tutorial --output "$PACKS"
125
+ codeql pack create ql/lib --output "$PACKS"
126
+ codeql pack create -j0 ql/src --output "$PACKS" --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}"
127
+ PACK_FOLDER=$(readlink -f "$PACKS"/codeql/ruby-queries/*)
127
128
codeql generate query-help --format=sarifv2.1.0 --output="${PACK_FOLDER}/rules.sarif" ql/src
128
129
(cd ql/src; find queries \( -name '*.qhelp' -o -name '*.rb' -o -name '*.erb' \) -exec bash -c 'mkdir -p "'"${PACK_FOLDER}"'/$(dirname "{}")"' \; -exec cp "{}" "${PACK_FOLDER}/{}" \;)
129
130
- uses : actions/upload-artifact@v3
130
131
with :
131
132
name : codeql-ruby-queries
132
133
path : |
133
- ruby/target/ packs/*
134
+ ${{ runner.temp }}/query- packs/*
134
135
retention-days : 1
135
136
136
137
package :
@@ -158,12 +159,12 @@ jobs:
158
159
mkdir -p ruby
159
160
cp -r codeql-extractor.yml tools ql/lib/ruby.dbscheme.stats ruby/
160
161
mkdir -p ruby/tools/{linux64,osx64,win64}
161
- cp linux64/ruby- autobuilder ruby/tools/linux64/autobuilder
162
- cp osx64/ruby- autobuilder ruby/tools/osx64/autobuilder
163
- cp win64/ruby- autobuilder.exe ruby/tools/win64/autobuilder.exe
164
- cp linux64/ruby- extractor ruby/tools/linux64/extractor
165
- cp osx64/ruby- extractor ruby/tools/osx64/extractor
166
- cp win64/ruby- extractor.exe ruby/tools/win64/extractor.exe
162
+ cp linux64/autobuilder ruby/tools/linux64/autobuilder
163
+ cp osx64/autobuilder ruby/tools/osx64/autobuilder
164
+ cp win64/autobuilder.exe ruby/tools/win64/autobuilder.exe
165
+ cp linux64/extractor ruby/tools/linux64/extractor
166
+ cp osx64/extractor ruby/tools/osx64/extractor
167
+ cp win64/extractor.exe ruby/tools/win64/extractor.exe
167
168
chmod +x ruby/tools/{linux64,osx64}/{autobuilder,extractor}
168
169
zip -rq codeql-ruby.zip ruby
169
170
- uses : actions/upload-artifact@v3
0 commit comments