Skip to content

Commit 0d7e5fa

Browse files
authored
Merge pull request #219 from microsoft/ps-run-tests-on-prs
PS: Run tests on PRs
2 parents d76de83 + e70d9ff commit 0d7e5fa

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

.github/workflows/powershell-pr-check.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
powershell-pr-check:
1111
name: powershell-pr-check
12-
runs-on: ubuntu-latest
12+
runs-on: windows-latest
1313
if: github.repository == 'microsoft/codeql'
1414
permissions:
1515
contents: read
@@ -23,6 +23,10 @@ jobs:
2323
uses: ./.github/actions/fetch-codeql
2424
with:
2525
channel: release
26-
- name: Compile PowerShell Queries
26+
- name: Install PowerShell
2727
run: |
28-
codeql query compile --check-only --keep-going powershell/ql/src
28+
$path = Split-Path (Get-Command codeql).Source
29+
./powershell/build.ps1 $path
30+
- name: Run QL tests
31+
run: |
32+
codeql test run --threads=0 powershell/ql/test

powershell/build.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ param (
33
)
44

55
$toolsWin64Folder = Join-Path (Join-Path (Join-Path $cliFolder "powershell") "tools") "win64"
6-
dotnet publish (Join-Path "extractor" "powershell.sln") -o $toolsWin64Folder
6+
dotnet publish (Join-Path "$PSScriptRoot/extractor" "powershell.sln" | Resolve-Path) -o $toolsWin64Folder
77
if ($LASTEXITCODE -ne 0) {
88
Write-Host "Build failed"
99
exit 1
1010
}
1111

1212
$powershellFolder = Join-Path -Path $cliFolder -ChildPath "powershell"
13-
Copy-Item -Path codeql-extractor.yml -Destination $powershellFolder -Force
14-
$qlLibFolder = Join-Path -Path "ql" -ChildPath "lib"
13+
Copy-Item -Path "$PSScriptRoot/codeql-extractor.yml" -Destination $powershellFolder -Force
14+
$qlLibFolder = Join-Path -Path "$PSScriptRoot/ql" -ChildPath "lib"
1515
Copy-Item -Path (Join-Path $qlLibFolder "semmlecode.powershell.dbscheme") -Destination $powershellFolder -Force
1616
Copy-Item -Path (Join-Path $qlLibFolder "semmlecode.powershell.dbscheme.stats") -Destination $powershellFolder -Force
17-
Copy-Item -Path "tools" -Destination $powershellFolder -Recurse -Force
17+
Copy-Item -Path "$PSScriptRoot/tools" -Destination $powershellFolder -Recurse -Force

0 commit comments

Comments
 (0)