Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

Wasm: Reenable the CI for Wasm #7998

Merged
merged 4 commits into from
Mar 30, 2020
Merged
Show file tree
Hide file tree
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
22 changes: 17 additions & 5 deletions eng/build-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

- name: buildScriptName
value: 'build.cmd'
- ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
- ${{ if and(ne(parameters.osGroup, 'Windows_NT'),ne(parameters.osGroup, 'WebAssembly')) }}: # probably want to do this differently so we can build Wasm on other platforms
- name: buildScriptName
value: './build.sh'

Expand Down Expand Up @@ -70,14 +70,20 @@ jobs:
- script: sh eng/install-native-dependencies.sh $(osGroup)
displayName: Install native dependencies

- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
- ${{ if or(eq(parameters.osGroup, 'Windows_NT'),eq(parameters.osGroup, 'WebAssembly')) }}:
# Necessary to install python
- script: eng\common\init-tools-native.cmd -InstallDirectory $(Build.SourcesDirectory)\native-tools -Force
displayName: Install native dependencies

# Build product
- script: $(buildScriptName) $(buildConfig) skiptests
displayName: Build product
- ${{ if contains(parameters.osGroup, 'WebAssembly') }}:
# Install Wasm dependencies: emscripten
- script: eng\install-emscripten.cmd $(Build.SourcesDirectory)\wasm-tools
displayName: Install/activate emscripten

# Build product, but not if Wasm as that builds and runs tests in one go
- ${{ if not(contains(parameters.osGroup, 'WebAssembly')) }}:
- script: $(buildScriptName) $(buildConfig) skiptests
displayName: Build product

# Run the requested test scenarios

Expand All @@ -99,6 +105,12 @@ jobs:
displayName: Run CoreFX tests
enabled: ${{ eq(parameters.buildConfig, 'Debug') }}

- ${{ if contains(parameters.osGroup, 'WebAssembly') }}:
- script: |
call $(Build.SourcesDirectory)\wasm-tools\emsdk\emsdk_env
call $(buildScriptName) wasm $(buildConfig)
displayName: Run Wasm tests

- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
Expand Down
20 changes: 20 additions & 0 deletions eng/install-emscripten.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
mkdir "%1" 2>nul
cd "%1"

git clone https://github.com/emscripten-core/emsdk.git

cd emsdk

powershell -NoProfile -NoLogo -ExecutionPolicy ByPass -command "& """%~dp0update-machine-certs.ps1""" %*"

rem Use the python that is downloaded to native-tools explicitly as its not on the path
call "%1"\..\native-tools\bin\python3 emsdk.py install 1.39.8
if %errorlevel% NEQ 0 goto fail
call emsdk activate 1.39.8
if %errorlevel% NEQ 0 goto fail

exit /b 0

fail:
echo "Failed to install emscripten"
exit /b 1
15 changes: 14 additions & 1 deletion eng/platform-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,17 @@ jobs:
osGroup: Linux
osIdentifier: Linux
containerName: ubuntu_1604_x64_build_image
${{ insert }}: ${{ parameters.jobParameters }}
${{ insert }}: ${{ parameters.jobParameters }}

# WebAssembly

- ${{ if and(ne(parameters.jobParameters.testScenarios, 'CoreFX'), ne(parameters.buildConfig, 'release')) }}: # Don't want the second job as it would be a duplicate. Release is failing the generics test so leave out for now.
- template: ${{ parameters.jobTemplate }}
parameters:
buildConfig: ${{ parameters.buildConfig }}
archType: wasm
osGroup: WebAssembly
osIdentifier: WebAssembly
${{ each param in parameters.jobParameters }}:
${{ if ne(param.key, 'testScenarios') }}: # Insert all properties other than "testScenarios"
${{ param.key }}: ${{ param.value }}
25 changes: 25 additions & 0 deletions eng/update-machine-certs.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This seems to update the machine cert store so that python can download the files as required by emscripten's install
$WebsiteURL="storage.googleapis.com"
Try {
$Conn = New-Object System.Net.Sockets.TcpClient($WebsiteURL,443)

Try {
$Stream = New-Object System.Net.Security.SslStream($Conn.GetStream())
$Stream.AuthenticateAsClient($WebsiteURL)

$Cert = $Stream.Get_RemoteCertificate()

$ValidTo = [datetime]::Parse($Cert.GetExpirationDatestring())

Write-Host "`nConnection Successfull" -ForegroundColor DarkGreen
Write-Host "Website: $WebsiteURL"
}
Catch { Throw $_ }
Finally { $Conn.close() }
}
Catch {
Write-Host "`nError occurred connecting to $($WebsiteURL)" -ForegroundColor Yellow
Write-Host "Website: $WebsiteURL"
Write-Host "Status:" $_.exception.innerexception.message -ForegroundColor Yellow
Write-Host ""
}
5 changes: 5 additions & 0 deletions eng/xplat-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ jobs:
${{ if and(eq(parameters.osGroup, 'Windows_NT'), eq(variables['System.TeamProject'], 'public')) }}:
name: NetCorePublic-Pool
queue: BuildPool.Windows.10.Amd64.VS2019.Open
${{ if and(eq(parameters.osGroup, 'WebAssembly'), eq(variables['System.TeamProject'], 'public')) }}:
name: NetCorePublic-Pool
queue: BuildPool.Windows.10.Amd64.VS2019.Open

workspace:
clean: all
Expand All @@ -56,6 +59,8 @@ jobs:
agentOs: MacOS
${{ if eq(parameters.osGroup, 'Windows_NT') }}:
agentOs: Windows_NT
${{ if eq(parameters.osGroup, 'WebAssembly') }}:
agentOs: Windows_NT

# Setting this results in the arcade job template including a step
# that gathers asset manifests and publishes them to pipeline
Expand Down
2 changes: 1 addition & 1 deletion tests/runtest.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ goto :eof
if /i "%__Mode%"=="wasm" (
REM Skip running if this is WASM build-only testing running in a different architecture's build
if /i not "%CoreRT_BuildArch%"=="wasm" (goto :RecordTestResult)
set __Extension=html
set __Extension=js
)

if "!__SavedErrorLevel!"=="0" (
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Simple/Generics/Generics.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
setlocal

IF /i "%__Mode%"=="wasm" (
call emrun --browser=firefox --browser_args=-headless --safe_firefox_profile --silence_timeout 100 "%1\%2"
call %EMSDK_NODE% "%1\%2"
) ELSE (
"%1\%2"
)
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Simple/HelloWasm/HelloWasm.cmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@echo off
setlocal

call emrun --browser=firefox --browser_args=-headless --safe_firefox_profile --silence_timeout 100 "%1\%2"
call %EMSDK_NODE% "%1\%2"

IF "%errorlevel%"=="100" (
echo %~n0: Pass
Expand Down