Skip to content

Commit 8d91ba2

Browse files
committed
QL: fix Esbens workflow comments
1 parent 77cb822 commit 8d91ba2

File tree

3 files changed

+36
-40
lines changed

3 files changed

+36
-40
lines changed

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

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uses: actions/cache@v2
2020
with:
2121
path: ${{ runner.temp }}/query-pack.zip
22-
key: ${{ runner.os }}-queries-${{ hashFiles('**/*.ql*') }}
22+
key: queries-${{ hashFiles('**/*.ql*') }}
2323
- name: Find codeql
2424
if: steps.cache-queries.outputs.cache-hit != 'true'
2525
id: find-codeql
@@ -140,21 +140,7 @@ jobs:
140140
with:
141141
languages: ql
142142
db-location: ${{ runner.temp }}/db
143-
- name: Print debug info
144-
run: |
145-
echo "Pack"
146-
ls ${{ runner.temp }}/pack
147-
echo "Tools"
148-
ls ${{ runner.temp }}/pack/tools
149-
echo "index-files"
150-
cat ${{ runner.temp }}/pack/tools/index-files.sh
151143

152144
- name: Perform CodeQL Analysis
153145
uses: github/codeql-action/analyze@esbena/ql
154146

155-
- name: Upload db
156-
uses: actions/upload-artifact@v2
157-
with:
158-
name: db
159-
path: ${{ runner.temp }}/db
160-
retention-days: 1

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

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,19 @@ jobs:
1616
env:
1717
CODEQL_THREADS: 4 # TODO: remove this once it's set by the CLI
1818
strategy:
19-
fail-fast: false
2019
matrix:
21-
repo: [github/codeql]
20+
repo:
21+
- github/codeql
22+
- github/codeql-go
2223
runs-on: ubuntu-latest
2324
steps:
2425
- uses: actions/checkout@v2
2526

26-
- name: Fetch CodeQL
27-
run: |
28-
LATEST=$(gh release list --repo https://github.com/github/codeql-cli-binaries | cut -f 1 | sort --version-sort | tail -1)
29-
gh release download --repo https://github.com/github/codeql-cli-binaries --pattern codeql-linux64.zip "$LATEST"
30-
unzip -q codeql-linux64.zip
31-
env:
32-
GITHUB_TOKEN: ${{ github.token }}
27+
- name: Find codeql
28+
id: find-codeql
29+
uses: github/codeql-action/init@esbena/ql
30+
with:
31+
languages: javascript # does not matter
3332
- uses: actions/cache@v2
3433
with:
3534
path: |
@@ -38,24 +37,29 @@ jobs:
3837
ql/target
3938
key: ${{ runner.os }}-qltest-cargo-${{ hashFiles('**/Cargo.lock') }}
4039
- name: Build Extractor
41-
run: cd ql; env "PATH=$PATH:${{ github.workspace }}/codeql" ./create-extractor-pack.sh
42-
40+
run: cd ql; env "PATH=$PATH:`dirname ${CODEQL}`" ./create-extractor-pack.sh
41+
env:
42+
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
4343
- name: Checkout ${{ matrix.repo }}
4444
uses: actions/checkout@v2
4545
with:
4646
repository: ${{ matrix.repo }}
4747
path: ${{ github.workspace }}/repo
4848
- name: Create database
4949
run: |
50-
codeql/codeql database create \
50+
"${CODEQL}" database create \
5151
--search-path "ql/" \
5252
--threads 4 \
5353
--language ql --source-root "${{ github.workspace }}/repo" \
5454
"${{ runner.temp }}/database"
55+
env:
56+
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
5557
- name: Measure database
5658
run: |
5759
mkdir -p "stats/${{ matrix.repo }}"
58-
codeql/codeql dataset measure --threads 4 --output "stats/${{ matrix.repo }}/stats.xml" "${{ runner.temp }}/database/db-ql"
60+
"${CODEQL}" dataset measure --threads 4 --output "stats/${{ matrix.repo }}/stats.xml" "${{ runner.temp }}/database/db-ql"
61+
env:
62+
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
5963
- uses: actions/upload-artifact@v2
6064
with:
6165
name: measurements
@@ -73,7 +77,7 @@ jobs:
7377
path: stats
7478
- run: |
7579
python -m pip install --user lxml
76-
find stats -name 'stats.xml' | sort | xargs python ql/scripts/merge_stats.py --output ql/ql/src/ql.dbscheme.stats --normalise ql_tokeninfo
80+
find stats -name 'stats.xml' -print0 | sort -z | xargs -0 python ql/scripts/merge_stats.py --output ql/ql/src/ql.dbscheme.stats --normalise ql_tokeninfo
7781
- uses: actions/upload-artifact@v2
7882
with:
7983
name: ql.dbscheme.stats

.github/workflows/ql-for-ql-tests.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- uses: actions/checkout@v2
21-
- name: Fetch CodeQL
22-
run: |
23-
LATEST=$(gh release list --repo https://github.com/github/codeql-cli-binaries | cut -f 1 | sort --version-sort | tail -1)
24-
gh release download --repo https://github.com/github/codeql-cli-binaries --pattern codeql-linux64.zip "$LATEST"
25-
unzip -q codeql-linux64.zip
26-
env:
27-
GITHUB_TOKEN: ${{ github.token }}
21+
- name: Find codeql
22+
id: find-codeql
23+
uses: github/codeql-action/init@esbena/ql
24+
with:
25+
languages: javascript # does not matter
2826
- uses: actions/cache@v2
2927
with:
3028
path: |
@@ -33,10 +31,18 @@ jobs:
3331
ql/target
3432
key: ${{ runner.os }}-qltest-cargo-${{ hashFiles('**/Cargo.lock') }}
3533
- name: Build Extractor
36-
run: cd ql; env "PATH=$PATH:${{ github.workspace }}/codeql" ./create-extractor-pack.sh
34+
run: cd ql; env "PATH=$PATH:`dirname ${CODEQL}`" ./create-extractor-pack.sh
35+
env:
36+
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
3737
- name: Run QL tests
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
38+
run: "${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
39+
env:
40+
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
3941
- name: Check QL formatting
40-
run: find ql/ql "(" -name "*.ql" -or -name "*.qll" ")" -print0 | xargs -0 codeql/codeql query format --check-only
42+
run: find ql/ql "(" -name "*.ql" -or -name "*.qll" ")" -print0 | xargs -0 "${CODEQL}" query format --check-only
43+
env:
44+
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
4145
- name: Check QL compilation
42-
run: codeql/codeql query compile --check-only --threads=4 --warnings=error --search-path "${{ github.workspace }}" "ql/ql/src" "ql/ql/examples"
46+
run: "${CODEQL}" query compile --check-only --threads=4 --warnings=error --search-path "${{ github.workspace }}" "ql/ql/src" "ql/ql/examples"
47+
env:
48+
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}

0 commit comments

Comments
 (0)