Skip to content

Commit 73bfa0b

Browse files
authored
Merge 50519d0 into e6e443b
2 parents e6e443b + 50519d0 commit 73bfa0b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+241438
-41
lines changed

.github/workflows/runChecks.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Run checks and build NVDA
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- beta
8+
- rc
9+
- try-**
10+
- release-**
11+
12+
pull_request:
13+
branches:
14+
- master
15+
- beta
16+
- rc
17+
- try-**
18+
- release-**
19+
20+
workflow_dispatch:
21+
env:
22+
if: $GITHUB_EVENT_NAME == 'pull_request'
23+
pullRequestNumber: ${{ github.event.number }}
24+
jobs:
25+
build:
26+
runs-on: windows-latest
27+
defaults:
28+
run:
29+
shell: cmd
30+
steps:
31+
- uses: actions/checkout@v4
32+
with:
33+
submodules: true
34+
- name: Install dependencies
35+
uses: actions/setup-python@v5
36+
with:
37+
python-version: '3.11'
38+
architecture: x86
39+
- name: Set version variables
40+
run: powershell.exe appveyor/scripts/setBuildVersionVars.ps1
41+
- name: Set scons args
42+
run: powershell.exe appveyor/scripts/setSconsArgs.ps1
43+
- name: Prepare source code
44+
run: scons source %sconsArgs% --all-cores
45+
- name: Run launcher
46+
run: scons launcher version=%version% --all-cores
47+
- name: Prepare for tests
48+
run: powershell.exe appveyor/scripts/tests/beforeTests.ps1
49+
- name: Install NVDA
50+
run: powershell.exe appveyor/scripts/installNVDA.ps1
51+
- name: Run system tests
52+
run: powershell.exe appveyor/scripts/tests/systemTests.ps1

appveyor/scripts/installNVDA.ps1

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,25 @@ if(!$env:release) {
44
$nvdaLauncherFile+="_snapshot"
55
}
66
$nvdaLauncherFile+="_${env:version}.exe"
7-
Set-AppveyorBuildVariable "nvdaLauncherFile" $nvdaLauncherFile
87
echo NVDALauncherFile: $NVDALauncherFile
98
$outputDir=$(resolve-path .\testOutput)
109
$installerLogFilePath="$outputDir\nvda_install.log"
1110
$installerProcess=start-process -FilePath "$nvdaLauncherFile" -ArgumentList "--install-silent --debug-logging --log-file $installerLogFilePath" -passthru
1211
try {
1312
$installerProcess | wait-process -Timeout 180 -ErrorAction Stop
1413
$errorCode=$installerProcess.ExitCode
15-
$installerLogFilePathToUpload = $installerLogFilePath
1614
} catch {
1715
echo "NVDA installer process timed out"
1816
$errorCode=1
19-
Add-AppveyorMessage "Unable to install NVDA prior to tests."
2017
# Since installer failed to exit in the specified timeout the log file is still in use.
2118
# Unfortunately `Push-AppveyorArtifact` is unable to upload a file which is locked
2219
# as a work around create a copy of the log and upload that instead.
2320
$installerLogFileCopiedPath = "nvda_install_copy.log"
2421
Copy-Item $installerLogFilePath $installerLogFileCopiedPath
25-
$installerLogFilePathToUpload = $installerLogFileCopiedPath
2622
}
27-
Push-AppveyorArtifact $installerLogFilePathToUpload -FileName "nvda_install.log"
2823
$crashDump = "$outputDir\nvda_crash.dmp"
2924
if (Test-Path -Path $crashDump){
30-
Push-AppveyorArtifact $crashDump -FileName "nvda_install_crash.dmp"
31-
Add-AppveyorMessage "Install process crashed"
3225
$errorCode=1
3326
}
3427
if($errorCode -ne 0) { $host.SetShouldExit($errorCode) }
28+
echo "nvdaLauncherFile=$nvdaLauncherFile" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append

appveyor/scripts/setBuildVersionVars.ps1

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,38 @@ $ErrorActionPreference = "Stop";
66
# Remove the password after the RDP connection params are shown in the build output.
77
# For passwords requirements and instructions for setting, see the appveyor docs:
88
# https://www.appveyor.com/docs/how-to/rdp-to-build-worker/
9-
if ($env:APPVEYOR_RDP_PASSWORD) {
10-
$rdpScriptURL = 'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'
11-
iex ((new-object net.webclient).DownloadString($rdpScriptURL))
12-
}
139

1410
$pythonVersion = (py --version)
1511
echo $pythonVersion
16-
if ($env:APPVEYOR_REPO_TAG_NAME -and $env:APPVEYOR_REPO_TAG_NAME.StartsWith("release-")) {
12+
if ($env:GITHUB_REF_TYPE -eq "tag" -and $env:GITHUB_REF_NAME.StartsWith("release-")) {
1713
# Strip "release-" prefix.
18-
$version = $env:APPVEYOR_REPO_TAG_NAME.Substring(8)
19-
Set-AppveyorBuildVariable "release" "1"
20-
if ($env:APPVEYOR_REPO_TAG_NAME.Contains("rc") -or $env:APPVEYOR_REPO_TAG_NAME.Contains("beta")) {
14+
$version = $env:GITHUB_REF_NAME.Substring(8)
15+
echo "release=1" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
16+
if ($env:GITHUB_REF_TYPE -eq "tag" -and ($env:GITHUB_REF_NAME.Contains("rc") -or $env:GITHUB_REF_NAME.Contains("beta"))) {
2117
$versionType = "beta"
2218
} else {
2319
$versionType = "stable"
2420
}
2521
} else {
26-
$commitVersion = $env:APPVEYOR_REPO_COMMIT.Substring(0, 8)
22+
$commitVersion = $env:GITHUB_SHA.Substring(0, 8)
2723
if($env:APPVEYOR_PULL_REQUEST_NUMBER) {
2824
$version = "pr$env:APPVEYOR_PULL_REQUEST_NUMBER-$env:APPVEYOR_BUILD_NUMBER," + $commitVersion
29-
} elseif($env:APPVEYOR_REPO_BRANCH -eq "master") {
30-
$version = "alpha-$env:APPVEYOR_BUILD_NUMBER," + $commitVersion
25+
} elseif($env:GITHUB_REF_NAME -eq "master") {
26+
$version = "alpha-$env:GITHUB_RUN_ID," + $commitVersion
3127
} else {
32-
$version = "$env:APPVEYOR_REPO_BRANCH-$env:APPVEYOR_BUILD_NUMBER," + $commitVersion
33-
if($env:APPVEYOR_REPO_BRANCH.StartsWith("try-release-")) {
34-
Set-AppveyorBuildVariable "release" "1"
28+
$version = "$env:GITHUB_REF_NAME-$env:GITHUB_RUN_ID," + $commitVersion
29+
if($env:GITHUB_REF_NAME.StartsWith("try-release-")) {
30+
echo "release=1" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
3531
}
3632
}
3733
# The version is unique even for rebuilds, so we can use it for the AppVeyor version.
38-
Update-AppveyorBuild -Version $version
39-
if($env:APPVEYOR_REPO_BRANCH -eq "master") {
34+
if($env:GITHUB_REF_NAME -eq "master") {
4035
$versionType = "snapshot:alpha"
41-
} elseif (!$env:APPVEYOR_REPO_BRANCH.StartsWith("try-")) {
42-
$versionType = "snapshot:$env:APPVEYOR_REPO_BRANCH"
36+
} elseif (!$env:GITHUB_REF_NAME.StartsWith("try-")) {
37+
$versionType = "snapshot:$env:GITHUB_REF_NAME"
4338
}
4439
}
45-
Set-AppveyorBuildVariable "version" $version
40+
echo "version=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
4641
if ($versionType) {
47-
Set-AppveyorBuildVariable "versionType" $versionType
42+
echo "versionType=$versionType" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
4843
}

appveyor/scripts/setSconsArgs.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ $sconsArgs += " publisher=`"$env:scons_publisher`""
1414
if (!$env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:feature_signing) {
1515
$sconsArgs += " apiSigningToken=$env:apiSigningToken"
1616
}
17-
$sconsArgs += " version_build=$env:APPVEYOR_BUILD_NUMBER"
17+
$sconsArgs += " version_build=$env:GITHUB_RUN_ID"
1818
# We use cmd to run scons because PowerShell throws exceptions if warnings get dumped to stderr.
1919
# It's possible to work around this, but the workarounds have annoying side effects.
20-
Set-AppveyorBuildVariable "sconsOutTargets" $sconsOutTargets
21-
Set-AppveyorBuildVariable "sconsArgs" $sconsArgs
20+
echo "sconsOutTargets=$sconsOutTargets" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
21+
echo "sconsArgs=$sconsArgs" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
2222
Write-Host "scons args: $sconsArgs"
2323
Write-Host "scons output targets: $sconsOutTargets"

appveyor/scripts/tests/beforeTests.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,3 @@ $chromeStartArgsString = $(py tests/system/libraries/_chromeArgs.py)
2121
$chromeStartArgsArray = $chromeStartArgsString -split " "
2222

2323
cmd /c start /min $chromeStartArgsArray
24-
Set-AppveyorBuildVariable "testFailExitCode" 0

appveyor/scripts/tests/systemTests.ps1

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,4 @@ $includeTags = $tagsForTestArray | ForEach-Object {
3434
--variable verboseDebugLogging:"${verboseDebugLogging}" `
3535
@includeTags `
3636
# last line intentionally blank, allowing all lines to have line continuations.
37-
38-
if($LastExitCode -ne 0) {
39-
Set-AppveyorBuildVariable "testFailExitCode" $LastExitCode
40-
Add-AppveyorMessage "FAIL: System tests (tags: ${tagsForTest}). See test results for more information."
41-
} else {
42-
Add-AppveyorMessage "PASS: System tests (tags: ${tagsForTest})."
43-
}
4437
Compress-Archive -Path "$systemTestOutput\*" -DestinationPath "$testOutput\systemTestResult.zip"
45-
Push-AppveyorArtifact "$testOutput\systemTestResult.zip"
46-
$wc = New-Object 'System.Net.WebClient'
47-
$wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "$systemTestOutput\systemTests.xml"))

installNVDA.ps1

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
$errorCode=0
2+
$nvdaLauncherFile="nvda"
3+
if(!$env:release) {
4+
$nvdaLauncherFile+="_snapshot"
5+
}
6+
$nvdaLauncherFile+="_${env:version}.exe"
7+
echo NVDALauncherFile: $NVDALauncherFile
8+
$outputDir=$(resolve-path .\testOutput)
9+
$installerLogFilePath="$outputDir\nvda_install.log"
10+
cd output
11+
$installerProcess=start-process -FilePath "$nvdaLauncherFile" -ArgumentList "--install-silent --debug-logging --log-file $installerLogFilePath" -passthru
12+
try {
13+
$installerProcess | wait-process -Timeout 180 -ErrorAction Stop
14+
$errorCode=$installerProcess.ExitCode
15+
$installerLogFilePathToUpload = $installerLogFilePath
16+
} catch {
17+
echo "NVDA installer process timed out"
18+
$errorCode=1
19+
# Since installer failed to exit in the specified timeout the log file is still in use.
20+
# Unfortunately `Push-AppveyorArtifact` is unable to upload a file which is locked
21+
# as a work around create a copy of the log and upload that instead.
22+
$installerLogFileCopiedPath = "nvda_install_copy.log"
23+
Copy-Item $installerLogFilePath $installerLogFileCopiedPath
24+
$installerLogFilePathToUpload = $installerLogFileCopiedPath
25+
}
26+
$crashDump = "$outputDir\nvda_crash.dmp"
27+
if (Test-Path -Path $crashDump){
28+
Push-AppveyorArtifact $crashDump -FileName "nvda_install_crash.dmp"
29+
$errorCode=1
30+
}
31+
if($errorCode -ne 0) { $host.SetShouldExit($errorCode) }

0 commit comments

Comments
 (0)