Skip to content

Commit d600556

Browse files
authored
CI: Get 32-bit Node via the official NodeTool task (atom#21490)
The official NodeTool@0 task can now download 32-bit Node even on Windows x64 hosts. (As of this PR: microsoft/azure-pipelines-tasks#13399)
1 parent b7ddd25 commit d600556

File tree

6 files changed

+13
-77
lines changed

6 files changed

+13
-77
lines changed

script/vsts/platforms/templates/bootstrap.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,7 @@ steps:
1717
}
1818
1919
# Bootstrap
20-
if (($env:AGENT_OS -eq "Windows_NT") -and ($env:BUILD_ARCH -eq "x86")) {
21-
node 'script\vsts\windows-run.js' 'script\bootstrap.cmd'
22-
}
23-
else {
24-
script/bootstrap
25-
}
20+
script/bootstrap
2621
displayName: Bootstrap build environment
2722
env:
2823
GITHUB_TOKEN: $(GITHUB_TOKEN)

script/vsts/platforms/templates/build.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ steps:
2929
3030
# Build
3131
$esc = '--%'
32-
if (($env:AGENT_OS -eq "Windows_NT") -and ($env:BUILD_ARCH -eq "x86")) {
33-
node 'script\vsts\windows-run.js' 'script\build.cmd' --no-bootstrap --compress-artifacts $esc $CodeSign $CreateWindowsInstallaer
34-
} else {
35-
script/build --no-bootstrap --compress-artifacts $esc $env:LinuxArgs $CodeSign $CreateWindowsInstallaer
36-
}
32+
script/build --no-bootstrap --compress-artifacts $esc $env:LinuxArgs $CodeSign $CreateWindowsInstallaer
3733
displayName: Build Atom
3834
env:
3935
GITHUB_TOKEN: $(GITHUB_TOKEN)

script/vsts/platforms/templates/preparation.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,19 @@ steps:
2020
condition: eq(variables['Agent.OS'], 'Linux')
2121

2222
# Common
23+
- pwsh: |
24+
if ($env:BUILD_ARCH -eq "x86") {
25+
echo "##vso[task.setvariable variable=IsWinX86]true"
26+
}
27+
displayName: Set "IsWinX86" based on "BUILD_ARCH"
28+
# Convert "BUILD_ARCH" to a boolean ("IsWinX86") for the following NodeTool task.
29+
# Templates evaluate too early for the matrix variable "BUILD_ARCH" to be available in ${{ template expressions }}.
30+
# Scripts are interpreted at runtime, so "BUILD_ARCH" will be available to this script, and we can set "IsWinX86".
31+
2332
- task: NodeTool@0
2433
inputs:
2534
versionSpec: 12.16.3
35+
force32bit: $(IsWinX86)
2636
displayName: Install Node.js 12.16.3
2737

2838
- script: npm install --global npm@6.14.8

script/vsts/platforms/templates/test.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ steps:
1010
if ($env:AGENT_OS -eq "Darwin") {
1111
osascript -e 'tell application "System Events" to keystroke "x"' # clear screen saver
1212
caffeinate -s script/test # Run with caffeinate to prevent screen saver
13-
} elseif (($env:AGENT_OS -eq "Windows_NT") -and ($env:BUILD_ARCH -eq "x86")) {
14-
node 'script\vsts\windows-run.js' 'script\test.cmd'
1513
} else {
1614
script/test
1715
}
@@ -28,12 +26,7 @@ steps:
2826
condition: and(succeeded(), ne(variables['Atom.SkipTests'], 'true'))
2927
3028
# Test results
31-
- pwsh: |
32-
if (($env:AGENT_OS -eq "Windows_NT") -and ($env:BUILD_ARCH -eq "x86")) {
33-
node 'script\vsts\windows-run.js' 'script\postprocess-junit-results.cmd' --search-folder "$env:TEST_JUNIT_XML_ROOT" --test-results-files "**/*.xml"
34-
} else {
35-
script/postprocess-junit-results --search-folder "$env:TEST_JUNIT_XML_ROOT" --test-results-files "**/*.xml"
36-
}
29+
- pwsh: script/postprocess-junit-results --search-folder "$env:TEST_JUNIT_XML_ROOT" --test-results-files "**/*.xml"
3730
env:
3831
TEST_JUNIT_XML_ROOT: $(Common.TestResultsDirectory)/junit
3932
displayName: Post-process test results

script/vsts/platforms/windows.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ jobs:
4343
$env:FileID=""
4444
}
4545
echo "##vso[task.setvariable variable=FileID]$env:FileID" # Azure syntax
46-
env:
47-
BUILD_ARCH: $(BUILD_ARCH)
4846
displayName: Set FileID based on the arch
4947
5048
- template: templates/publish.yml
@@ -111,8 +109,6 @@ jobs:
111109
$env:FileID=""
112110
}
113111
echo "##vso[task.setvariable variable=FileID]$env:FileID" # Azure syntax
114-
env:
115-
BUILD_ARCH: $(BUILD_ARCH)
116112
displayName: Set FileID based on the arch
117113
118114
- template: templates/download-unzip.yml

script/vsts/windows-run.js

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)