@@ -55,35 +55,35 @@ jobs:
5555 id : cache-extractor
5656 with :
5757 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') }}
6464 - uses : actions/cache@v3
6565 if : steps.cache-extractor.outputs.cache-hit != 'true'
6666 with :
6767 path : |
6868 ~/.cargo/registry
6969 ~/.cargo/git
7070 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') }}
7272 - name : Check formatting
7373 if : steps.cache-extractor.outputs.cache-hit != 'true'
74- run : cargo fmt --all -- --check
74+ run : cd extractor && cargo fmt --all -- --check
7575 - name : Build
7676 if : steps.cache-extractor.outputs.cache-hit != 'true'
77- run : cargo build --verbose
77+ run : cd extractor && cargo build --verbose
7878 - name : Run tests
7979 if : steps.cache-extractor.outputs.cache-hit != 'true'
80- run : cargo test --verbose
80+ run : cd extractor && cargo test --verbose
8181 - name : Release build
8282 if : steps.cache-extractor.outputs.cache-hit != 'true'
83- run : cargo build --release
83+ run : cd extractor && cargo build --release
8484 - name : Generate dbscheme
8585 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
8787 - uses : actions/upload-artifact@v3
8888 if : ${{ matrix.os == 'ubuntu-latest' }}
8989 with :
@@ -98,10 +98,10 @@ jobs:
9898 with :
9999 name : extractor-${{ matrix.os }}
100100 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
105105 retention-days : 1
106106 compile-queries :
107107 runs-on : ubuntu-latest-xl
@@ -116,21 +116,22 @@ jobs:
116116 key : ruby-build
117117 - name : Build Query Pack
118118 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/*)
127128 codeql generate query-help --format=sarifv2.1.0 --output="${PACK_FOLDER}/rules.sarif" ql/src
128129 (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}/{}" \;)
129130 - uses : actions/upload-artifact@v3
130131 with :
131132 name : codeql-ruby-queries
132133 path : |
133- ruby/target/ packs/*
134+ ${{ runner.temp }}/query- packs/*
134135 retention-days : 1
135136
136137 package :
@@ -158,12 +159,12 @@ jobs:
158159 mkdir -p ruby
159160 cp -r codeql-extractor.yml tools ql/lib/ruby.dbscheme.stats ruby/
160161 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
167168 chmod +x ruby/tools/{linux64,osx64}/{autobuilder,extractor}
168169 zip -rq codeql-ruby.zip ruby
169170 - uses : actions/upload-artifact@v3
0 commit comments