@@ -31,25 +31,17 @@ jobs:
31
31
id : cache-queries
32
32
uses : actions/cache@v3
33
33
with :
34
- path : ${{ runner.temp }}/query- pack.zip
34
+ path : ${{ runner.temp }}/pack
35
35
key : queries-${{ hashFiles('ql/**/*.ql*') }}-${{ hashFiles('ql/**/qlpack.yml') }}-${{ hashFiles('ql/ql/src/ql.dbscheme*') }}-${{ steps.get-codeql-version.outputs.version }}--${{ hashFiles('.github/workflows/ql-for-ql-build.yml') }}
36
36
- name : Build query pack
37
37
if : steps.cache-queries.outputs.cache-hit != 'true'
38
38
run : |
39
39
cd ql/ql/src
40
40
"${CODEQL}" pack create -j 16
41
- cd .codeql/pack/codeql/ql/0.0.0
42
- zip "${PACKZIP}" -r .
43
- rm -rf *
41
+ mv .codeql/pack/codeql/ql/0.0.0 ${{ runner.temp }}/pack
44
42
env :
45
43
CODEQL : ${{ steps.find-codeql.outputs.codeql-path }}
46
- PACKZIP : ${{ runner.temp }}/query-pack.zip
47
- - name : Upload query pack
48
- uses : actions/upload-artifact@v3
49
- with :
50
- name : query-pack-zip
51
- path : ${{ runner.temp }}/query-pack.zip
52
-
44
+
53
45
# ## Build the extractor ###
54
46
- name : Cache entire extractor
55
47
id : cache-extractor
@@ -85,59 +77,19 @@ jobs:
85
77
- name : Generate dbscheme
86
78
if : steps.cache-extractor.outputs.cache-hit != 'true'
87
79
run : ql/target/release/ql-generator --dbscheme ql/ql/src/ql.dbscheme --library ql/ql/src/codeql_ql/ast/internal/TreeSitter.qll
88
- - uses : actions/upload-artifact@v3
89
- with :
90
- name : extractor-ubuntu-latest
91
- path : |
92
- ql/target/release/ql-autobuilder
93
- ql/target/release/ql-autobuilder.exe
94
- ql/target/release/ql-extractor
95
- ql/target/release/ql-extractor.exe
96
- retention-days : 1
97
80
98
81
# ## Package the queries and extractor ###
99
- - uses : actions/download-artifact@v3
100
- with :
101
- name : query-pack-zip
102
- path : query-pack-zip
103
- - uses : actions/download-artifact@v3
104
- with :
105
- name : extractor-ubuntu-latest
106
- path : linux64
107
82
- run : |
108
- unzip query-pack-zip/*.zip -d pack
109
- cp -r ql/codeql-extractor.yml ql/tools ql/ql/src/ql.dbscheme.stats pack/
110
- mkdir -p pack/tools/linux64
111
- if [[ -f linux64/ql-autobuilder ]]; then
112
- cp linux64/ql-autobuilder pack/tools/linux64/autobuilder
113
- chmod +x pack/tools/linux64/autobuilder
114
- fi
115
- if [[ -f linux64/ql-extractor ]]; then
116
- cp linux64/ql-extractor pack/tools/linux64/extractor
117
- chmod +x pack/tools/linux64/extractor
118
- fi
119
- cd pack
120
- zip -rq ../codeql-ql.zip .
121
- rm -rf *
122
- - uses : actions/upload-artifact@v3
123
- with :
124
- name : codeql-ql-pack
125
- path : codeql-ql.zip
126
- retention-days : 1
83
+ cp -r ql/codeql-extractor.yml ql/tools ql/ql/src/ql.dbscheme.stats ${PACK}/
84
+ mkdir -p ${PACK}/tools/linux64
85
+ cp ql/target/release/ql-autobuilder ${PACK}/tools/linux64/autobuilder
86
+ cp ql/target/release/ql-extractor ${PACK}/tools/linux64/extractor
87
+ chmod +x ${PACK}/tools/linux64/autobuilder
88
+ chmod +x ${PACK}/tools/linux64/extractor
89
+ env:
90
+ PACK: ${{ runner.temp }}/pack
127
91
128
92
# ## Run the analysis ###
129
- - name : Download pack
130
- uses : actions/download-artifact@v3
131
- with :
132
- name : codeql-ql-pack
133
- path : ${{ runner.temp }}/codeql-ql-pack-artifact
134
-
135
- - name : Prepare pack
136
- run : |
137
- unzip "${PACK_ARTIFACT}/*.zip" -d "${PACK}"
138
- env :
139
- PACK_ARTIFACT : ${{ runner.temp }}/codeql-ql-pack-artifact
140
- PACK : ${{ runner.temp }}/pack
141
93
- name : Hack codeql-action options
142
94
run : |
143
95
JSON=$(jq -nc --arg pack "${PACK}" '.database."run-queries"=["--search-path", $pack] | .resolve.queries=["--search-path", $pack] | .resolve.extractor=["--search-path", $pack] | .database.init=["--search-path", $pack]')
0 commit comments