@@ -33,19 +33,73 @@ jobs:
33
33
~/.cargo/registry
34
34
~/.cargo/git
35
35
ql/target
36
- key : ${{ runner.os }}-${{ steps.os_version.outputs.version }}-qltest-cargo-${{ hashFiles('ql/**/Cargo.lock') }}
36
+ key : ${{ runner.os }}-${{ steps.os_version.outputs.version }}-qltest-cargo-${{ hashFiles('ql/rust-toolchain.toml', 'ql/ **/Cargo.lock') }}
37
37
- name : Build extractor
38
38
run : |
39
39
cd ql;
40
40
codeqlpath=$(dirname ${{ steps.find-codeql.outputs.codeql-path }});
41
41
env "PATH=$PATH:$codeqlpath" ./scripts/create-extractor-pack.sh
42
+ - name : Cache compilation cache
43
+ id : query-cache
44
+ uses : ./.github/actions/cache-query-compilation
45
+ with :
46
+ key : ql-for-ql-tests
42
47
- name : Run QL tests
43
48
run : |
44
- "${CODEQL}" test run --check-databases --check-unused-labels --check-repeated-labels --check-redefined-labels --check-use-before-definition --search-path "${{ github.workspace }}/ql/extractor-pack" --consistency-queries ql/ql/consistency-queries ql/ql/test
49
+ "${CODEQL}" test run --check-databases --check-unused-labels --check-repeated-labels --check-redefined-labels --check-use-before-definition --search-path "${{ github.workspace }}/ql/extractor-pack" --consistency-queries ql/ql/consistency-queries --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}" ql/ql/test
45
50
env :
46
51
CODEQL : ${{ steps.find-codeql.outputs.codeql-path }}
47
- - name : Check QL formatting
52
+
53
+ other-os :
54
+ strategy :
55
+ matrix :
56
+ os : [macos-latest, windows-latest]
57
+ needs : [qltest]
58
+ runs-on : ${{ matrix.os }}
59
+ steps :
60
+ - uses : actions/checkout@v3
61
+ - name : Install GNU tar
62
+ if : runner.os == 'macOS'
63
+ run : |
64
+ brew install gnu-tar
65
+ echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH
66
+ - name : Find codeql
67
+ id : find-codeql
68
+ uses : github/codeql-action/init@77a8d2d10c0b403a8b4aadbd223dc489ecd22683
69
+ with :
70
+ languages : javascript # does not matter
71
+ - uses : ./.github/actions/os-version
72
+ id : os_version
73
+ - uses : actions/cache@v3
74
+ with :
75
+ path : |
76
+ ~/.cargo/registry
77
+ ~/.cargo/git
78
+ ql/target
79
+ key : ${{ runner.os }}-${{ steps.os_version.outputs.version }}-qltest-cargo-${{ hashFiles('ql/rust-toolchain.toml', 'ql/**/Cargo.lock') }}
80
+ - name : Build extractor
81
+ if : runner.os != 'Windows'
82
+ run : |
83
+ cd ql;
84
+ codeqlpath=$(dirname ${{ steps.find-codeql.outputs.codeql-path }});
85
+ env "PATH=$PATH:$codeqlpath" ./scripts/create-extractor-pack.sh
86
+ - name : Build extractor (Windows)
87
+ if : runner.os == 'Windows'
88
+ shell : pwsh
48
89
run : |
49
- find ql/ql/src "(" -name "*.ql" -or -name "*.qll" ")" -print0 | xargs -0 "${CODEQL}" query format --check-only
90
+ cd ql;
91
+ $Env:PATH += ";$(dirname ${{ steps.find-codeql.outputs.codeql-path }})"
92
+ pwsh ./scripts/create-extractor-pack.ps1
93
+ - name : Run a single QL tests - Unix
94
+ if : runner.os != 'Windows'
95
+ run : |
96
+ "${CODEQL}" test run --check-databases --search-path "${{ github.workspace }}/ql/extractor-pack" ql/ql/test/queries/style/DeadCode/DeadCode.qlref
50
97
env :
51
98
CODEQL : ${{ steps.find-codeql.outputs.codeql-path }}
99
+ - name : Run a single QL tests - Windows
100
+ if : runner.os == 'Windows'
101
+ shell : pwsh
102
+ run : |
103
+ $Env:PATH += ";$(dirname ${{ steps.find-codeql.outputs.codeql-path }})"
104
+ codeql test run --check-databases --search-path "${{ github.workspace }}/ql/extractor-pack" ql/ql/test/queries/style/DeadCode/DeadCode.qlref
105
+
0 commit comments