Skip to content

Commit 188a6b1

Browse files
committed
QL: Merge branch 'main' into missing-nomagic
2 parents 21caef3 + 02c2603 commit 188a6b1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+3142
-1981
lines changed

.github/workflows/codeql-analysis.yml renamed to .github/workflows/bleeding-codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "CodeQL"
1+
name: "CodeQL with bleeding edge queries and extractor"
22

33
on:
44
workflow_dispatch:
@@ -62,7 +62,7 @@ jobs:
6262
- name: Release build
6363
run: cargo build --release
6464
- name: Generate dbscheme
65-
run: target/release/ql-generator
65+
run: target/release/ql-generator --dbscheme ql/src/ql.dbscheme --library ql/src/codeql_ql/ast/internal/TreeSitter.qll
6666
- uses: actions/upload-artifact@v2
6767
with:
6868
name: ql.dbscheme

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
run: cargo build --release
4444
- name: Generate dbscheme
4545
if: ${{ matrix.os == 'ubuntu-latest' }}
46-
run: target/release/ql-generator
46+
run: target/release/ql-generator --dbscheme ql/src/ql.dbscheme --library ql/src/codeql_ql/ast/internal/TreeSitter.qll
4747
- uses: actions/upload-artifact@v2
4848
if: ${{ matrix.os == 'ubuntu-latest' }}
4949
with:

.github/workflows/dataset_measure.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
path: stats
7474
- run: |
7575
python -m pip install --user lxml
76-
find stats -name 'stats.xml' | sort | xargs python scripts/merge_stats.py --output ql/src/ql.dbscheme.stats --normalise tokeninfo
76+
find stats -name 'stats.xml' | sort | xargs python scripts/merge_stats.py --output ql/src/ql.dbscheme.stats --normalise ql_tokeninfo
7777
- uses: actions/upload-artifact@v2
7878
with:
7979
name: ql.dbscheme.stats
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: "CodeQL with published queries and extractor"
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ main ]
7+
pull_request:
8+
# The branches below must be a subset of the branches above
9+
branches: [ main ]
10+
11+
jobs:
12+
13+
analyze:
14+
name: Analyze
15+
16+
runs-on: ubuntu-latest
17+
18+
permissions:
19+
actions: read
20+
contents: read
21+
security-events: write
22+
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v2
26+
27+
- name: Download pack
28+
run: |
29+
# adjust this line to make the workflow work in other repositories
30+
# the ql-qlpack.zip file can be downloaded at:
31+
# - https://github.com/github/codeql-ql/releases
32+
# - https://github.com/github/codeql-ql/actions/workflows/bleeding-codeql-analysis.yml
33+
gh release download latest --pattern ql-qlpack.zip
34+
unzip ql-qlpack.zip -d "${PACK}"
35+
env:
36+
PACK: ${{ runner.temp }}/ql-qlpack
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- name: Hack codeql-action options
40+
run: |
41+
JSON=$(jq -nc --arg pack "${PACK}" '.resolve.queries=["--search-path", $pack] | .resolve.extractor=["--search-path", $pack] | .database.init=["--search-path", $pack]')
42+
echo "CODEQL_ACTION_EXTRA_OPTIONS=${JSON}" >> ${GITHUB_ENV}
43+
env:
44+
PACK: ${{ runner.temp }}/ql-qlpack
45+
46+
- name: Initialize CodeQL
47+
uses: github/codeql-action/init@esbena/ql
48+
with:
49+
languages: ql
50+
db-location: ${{ runner.temp }}/db
51+
52+
- name: Perform CodeQL Analysis
53+
uses: github/codeql-action/analyze@esbena/ql

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

create-extractor-pack.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cargo build --release
22

3-
cargo run --release -p ql-generator
3+
cargo run --release -p ql-generator -- --dbscheme ql/src/ql.dbscheme --library ql/src/codeql_ql/ast/internal/
44
codeql query format -i ql\src\codeql_ql\ast\internal\TreeSitter.qll
55

66
if (Test-Path -Path extractor-pack) {

create-extractor-pack.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fi
1212

1313
cargo build --release
1414

15-
cargo run --release -p ql-generator
15+
cargo run --release -p ql-generator -- --dbscheme ql/src/ql.dbscheme --library ql/src/codeql_ql/ast/internal/TreeSitter.qll
1616
codeql query format -i ql/src/codeql_ql/ast/internal/TreeSitter.qll
1717

1818
rm -rf extractor-pack

0 commit comments

Comments
 (0)