Skip to content

Commit 1d62751

Browse files
committed
test QL-for-QL on mac/win
1 parent 8ccc384 commit 1d62751

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

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

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
~/.cargo/registry
3434
~/.cargo/git
3535
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') }}
3737
- name: Build extractor
3838
run: |
3939
cd ql;
@@ -49,3 +49,41 @@ jobs:
4949
find ql/ql/src "(" -name "*.ql" -or -name "*.qll" ")" -print0 | xargs -0 "${CODEQL}" query format --check-only
5050
env:
5151
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
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+
run: |
82+
cd ql;
83+
codeqlpath=$(dirname ${{ steps.find-codeql.outputs.codeql-path }});
84+
env "PATH=$PATH:$codeqlpath" ./scripts/create-extractor-pack.sh
85+
- name: Run a single QL tests
86+
run: |
87+
"${CODEQL}" test run --check-databases --search-path "${{ github.workspace }}/ql/extractor-pack" ql/ql/test/queries/style/DeadCode/DeadCode.qlref
88+
env:
89+
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}

ql/rust-toolchain.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This file specifies the Rust version used to develop and test the QL
2+
# extractor. It is set to the lowest version of Rust we want to support.
3+
4+
[toolchain]
5+
channel = "1.54"
6+
profile = "minimal"
7+
components = [ "rustfmt" ]

0 commit comments

Comments
 (0)