Skip to content

Commit f5788b9

Browse files
committed
QL: adjust remaining workflows to work in the QL folder
1 parent fdb15d6 commit f5788b9

File tree

4 files changed

+38
-28
lines changed

4 files changed

+38
-28
lines changed

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

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

33
on:
44
workflow_dispatch:
@@ -7,13 +7,11 @@ on:
77
pull_request:
88
# The branches below must be a subset of the branches above
99
branches: [ main ]
10-
schedule:
11-
- cron: '21 18 * * 5'
1210

1311
jobs:
1412

1513
build:
16-
uses: github/codeql-ql/.github/workflows/build.yml@main
14+
uses: github/codeql-ql/.github/workflows/ql-for-ql-build.yml@erik-krogh/publish-ql-for-ql # TODO: Change to `github/codeql`.
1715
with:
1816
os: '[ "ubuntu-latest" ]'
1917

@@ -58,6 +56,14 @@ jobs:
5856
with:
5957
languages: ql
6058
db-location: ${{ runner.temp }}/db
59+
- name: Print debug info
60+
run: |
61+
echo "Pack"
62+
ls ${{ runner.temp }}/pack
63+
echo "Tools"
64+
ls ${{ runner.temp }}/pack/tools
65+
echo "index-files"
66+
cat ${{ runner.temp }}/pack/tools/index-files.sh
6167
6268
- name: Perform CodeQL Analysis
6369
uses: github/codeql-action/analyze@esbena/ql

.github/workflows/build.yml renamed to .github/workflows/ql-for-ql-build.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build codeql-ql-pack
1+
name: Build CodeQL for CodeQL
22

33
on:
44
push:
@@ -27,7 +27,7 @@ jobs:
2727
languages: javascript # does not matter
2828
- name: Build query pack
2929
run: |
30-
cd ql/src
30+
cd ql/ql/src
3131
"${CODEQL}" pack create
3232
cd .codeql/pack/codeql/ql-all/0.0.0
3333
zip "${PACKZIP}" -r .
@@ -60,25 +60,25 @@ jobs:
6060
path: |
6161
~/.cargo/registry
6262
~/.cargo/git
63-
target
63+
ql/target
6464
key: ${{ runner.os }}-rust-cargo-${{ hashFiles('**/Cargo.lock') }}
6565
- name: Check formatting
66-
run: cargo fmt --all -- --check
66+
run: cd ql; cargo fmt --all -- --check
6767
- name: Build
68-
run: cargo build --verbose
68+
run: cd ql; cargo build --verbose
6969
- name: Run tests
70-
run: cargo test --verbose
70+
run: cd ql; cargo test --verbose
7171
- name: Release build
72-
run: cargo build --release
72+
run: cd ql; cargo build --release
7373
- name: Generate dbscheme
7474
if: ${{ matrix.os == 'ubuntu-latest' }}
75-
run: target/release/ql-generator --dbscheme ql/src/ql.dbscheme --library ql/src/codeql_ql/ast/internal/TreeSitter.qll
75+
run: ql/target/release/ql-generator --dbscheme ql/ql/src/ql.dbscheme --library ql/ql/src/codeql_ql/ast/internal/TreeSitter.qll
7676
- uses: actions/upload-artifact@v2
7777
with:
7878
name: extractor-${{ matrix.os }}
7979
path: |
80-
target/release/ql-extractor
81-
target/release/ql-extractor.exe
80+
ql/target/release/ql-extractor
81+
ql/target/release/ql-extractor.exe
8282
retention-days: 1
8383
package:
8484
runs-on: ubuntu-latest
@@ -110,7 +110,7 @@ jobs:
110110
path: osx64
111111
- run: |
112112
unzip query-pack-zip/*.zip -d pack
113-
cp -r codeql-extractor.yml tools ql/src/ql.dbscheme.stats pack/
113+
cp -r ql/codeql-extractor.yml ql/tools ql/ql/src/ql.dbscheme.stats pack/
114114
mkdir -p pack/tools/{linux64,osx64,win64}
115115
if [[ -f linux64/ql-extractor ]]; then
116116
cp linux64/ql-extractor pack/tools/linux64/extractor

.github/workflows/dataset_measure.yml renamed to .github/workflows/ql-for-ql-dataset_measure.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
name: Collect database stats
1+
name: Collect database stats for CodeQL for CodeQL
22

33
on:
44
push:
55
branches: [main]
66
paths:
7-
- ql/src/ql.dbscheme
7+
- ql/ql/src/ql.dbscheme
88
pull_request:
99
branches: [main]
1010
paths:
11-
- ql/src/ql.dbscheme
11+
- ql/ql/src/ql.dbscheme
1212
workflow_dispatch:
1313

1414
jobs:
@@ -35,10 +35,10 @@ jobs:
3535
path: |
3636
~/.cargo/registry
3737
~/.cargo/git
38-
target
38+
ql/target
3939
key: ${{ runner.os }}-qltest-cargo-${{ hashFiles('**/Cargo.lock') }}
4040
- name: Build Extractor
41-
run: env "PATH=$PATH:${{ github.workspace }}/codeql" ./create-extractor-pack.sh
41+
run: cd ql; env "PATH=$PATH:${{ github.workspace }}/codeql" ./create-extractor-pack.sh
4242

4343
- name: Checkout ${{ matrix.repo }}
4444
uses: actions/checkout@v2
@@ -73,8 +73,8 @@ 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 ql_tokeninfo
76+
find stats -name 'stats.xml' | sort | xargs python ql/scripts/merge_stats.py --output ql/ql/src/ql.dbscheme.stats --normalise ql_tokeninfo
7777
- uses: actions/upload-artifact@v2
7878
with:
7979
name: ql.dbscheme.stats
80-
path: ql/src/ql.dbscheme.stats
80+
path: ql/ql/src/ql.dbscheme.stats

.github/workflows/qltest.yml renamed to .github/workflows/ql-for-ql-tests.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
name: Run QL Tests
1+
name: Run CodeQL for CodeQL Tests
22

33
on:
44
push:
55
branches: [main]
6+
paths:
7+
- ql/*
68
pull_request:
79
branches: [main]
10+
paths:
11+
- ql/*
812

913
env:
1014
CARGO_TERM_COLOR: always
@@ -26,13 +30,13 @@ jobs:
2630
path: |
2731
~/.cargo/registry
2832
~/.cargo/git
29-
target
33+
ql/target
3034
key: ${{ runner.os }}-qltest-cargo-${{ hashFiles('**/Cargo.lock') }}
3135
- name: Build Extractor
32-
run: env "PATH=$PATH:${{ github.workspace }}/codeql" ./create-extractor-pack.sh
36+
run: cd ql; env "PATH=$PATH:${{ github.workspace }}/codeql" ./create-extractor-pack.sh
3337
- name: Run QL tests
34-
run: codeql/codeql test run --check-databases --check-unused-labels --check-repeated-labels --check-redefined-labels --check-use-before-definition --search-path "${{ github.workspace }}" --consistency-queries ql/consistency-queries ql/test
38+
run: codeql/codeql test run --check-databases --check-unused-labels --check-repeated-labels --check-redefined-labels --check-use-before-definition --search-path "${{ github.workspace }}"/ql --consistency-queries ql/ql/consistency-queries ql/ql/test
3539
- name: Check QL formatting
36-
run: find ql "(" -name "*.ql" -or -name "*.qll" ")" -print0 | xargs -0 codeql/codeql query format --check-only
40+
run: find ql/ql "(" -name "*.ql" -or -name "*.qll" ")" -print0 | xargs -0 codeql/codeql query format --check-only
3741
- name: Check QL compilation
38-
run: codeql/codeql query compile --check-only --threads=4 --warnings=error --search-path "${{ github.workspace }}" "ql/src" "ql/examples"
42+
run: codeql/codeql query compile --check-only --threads=4 --warnings=error --search-path "${{ github.workspace }}" "ql/ql/src" "ql/ql/examples"

0 commit comments

Comments
 (0)