Skip to content

Use codeql.exe instead of codeql.cmd on Windows #286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 27 additions & 25 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
os: [windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
@@ -25,25 +25,25 @@ jobs:
npm run build-ci
shell: bash

- name: Prepare artifacts
if: matrix.os == 'ubuntu-latest'
run: |
mkdir artifacts
cp dist/*.vsix artifacts
# - name: Prepare artifacts
# if: matrix.os == 'ubuntu-latest'
# run: |
# mkdir artifacts
# cp dist/*.vsix artifacts

- name: Upload artifacts
uses: actions/upload-artifact@master
if: matrix.os == 'ubuntu-latest'
with:
name: vscode-codeql-extension
path: artifacts
# - name: Upload artifacts
# uses: actions/upload-artifact@master
# if: matrix.os == 'ubuntu-latest'
# with:
# name: vscode-codeql-extension
# path: artifacts

test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
os: [windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
@@ -56,39 +56,41 @@ jobs:

# We have to build the dependencies in `lib` before running any tests.
- name: Build
if: matrix.os == 'windows-latest'
run: |
cd build
npm install
npm run build-ci
shell: bash

- name: Install CodeQL
if: matrix.os == 'windows-latest'
run: |
mkdir codeql-home
curl -L --silent https://github.com/github/codeql-cli-binaries/releases/latest/download/codeql.zip -o codeql-home/codeql.zip
unzip -q -o codeql-home/codeql.zip -d codeql-home
rm codeql-home/codeql.zip
shell: bash

- name: Run unit tests (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
cd extensions/ql-vscode
CODEQL_PATH=$GITHUB_WORKSPACE/codeql-home/codeql/codeql npm run test
# - name: Run unit tests (Linux)
# if: matrix.os == 'ubuntu-latest'
# run: |
# cd extensions/ql-vscode
# CODEQL_PATH=$GITHUB_WORKSPACE/codeql-home/codeql/codeql npm run test

- name: Run unit tests (Windows)
if: matrix.os == 'windows-latest'
run: |
cd extensions/ql-vscode
$env:CODEQL_PATH=$(Join-Path $env:GITHUB_WORKSPACE -ChildPath 'codeql-home/codeql/codeql.cmd')
$env:CODEQL_PATH=$(Join-Path $env:GITHUB_WORKSPACE -ChildPath 'codeql-home/codeql/codeql.exe')
npm run test

- name: Run integration tests (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
cd extensions/ql-vscode
sudo apt-get install xvfb
/usr/bin/xvfb-run npm run integration
# - name: Run integration tests (Linux)
# if: matrix.os == 'ubuntu-latest'
# run: |
# cd extensions/ql-vscode
# sudo apt-get install xvfb
# /usr/bin/xvfb-run npm run integration

- name: Run integration tests (Windows)
if: matrix.os == 'windows-latest'
2 changes: 1 addition & 1 deletion extensions/ql-vscode/package.json
Original file line number Diff line number Diff line change
@@ -99,7 +99,7 @@
"scope": "machine",
"type": "string",
"default": "",
"description": "Path to the CodeQL executable that should be used by the CodeQL extension. The executable is named `codeql` on Linux/Mac and `codeql.cmd` on Windows. This overrides all other CodeQL CLI settings."
"description": "Path to the CodeQL executable that should be used by the CodeQL extension. The executable is named `codeql` on Linux/Mac and `codeql.exe` on Windows. This overrides all other CodeQL CLI settings."
},
"codeQL.runningQueries.numberOfThreads": {
"type": "integer",
2 changes: 1 addition & 1 deletion extensions/ql-vscode/src/distribution.ts
Original file line number Diff line number Diff line change
@@ -502,7 +502,7 @@ export function versionCompare(a: Version, b: Version): number {
}

function codeQlLauncherName(): string {
return (os.platform() === "win32") ? "codeql.cmd" : "codeql";
return (os.platform() === "win32") ? "codeql.exe" : "codeql";
}

function isRedirectStatusCode(statusCode: number): boolean {