1+ name : Node Binding (DirectML backend / Windows)
2+
3+ on : [push, pull_request]
4+
5+ jobs :
6+
7+ job :
8+
9+ runs-on : windows-2019
10+
11+ steps :
12+ - name : Git config
13+ run : |
14+ git config --global core.autocrlf false
15+ git config --global core.eol lf
16+
17+ - name : Install depot_tools
18+ shell : cmd
19+ run : |
20+ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git ..\depot_tools
21+ set "PATH=%CD%\..\depot_tools;%PATH%"
22+ gclient
23+
24+ - name : Set up Python 3.x
25+ uses : actions/setup-python@v2
26+ with :
27+ python-version : ' 3.x'
28+
29+ - uses : actions/setup-node@v2
30+ with :
31+ node-version : ' 14'
32+
33+ - uses : actions/checkout@v2
34+ with :
35+ ref : main
36+ path : baseline
37+ fetch-depth : 0
38+
39+ - name : Update DEPS for main branch
40+ shell : pwsh
41+ run : |
42+ cd baseline
43+ (Get-Content -path .\DEPS -Raw) -replace "'checkout_onnxruntime': True", "'checkout_onnxruntime': False" | Set-Content -path .\DEPS
44+ (Get-Content -path .\DEPS -Raw) -replace "'checkout_samples': True", "'checkout_samples': False" | Set-Content -path .\DEPS
45+
46+ - name : Sync code for main branch
47+ shell : cmd
48+ run : |
49+ set "PATH=%CD%\..\depot_tools;%PATH%"
50+ set "DEPOT_TOOLS_WIN_TOOLCHAIN=0"
51+ cd baseline
52+ copy scripts\standalone.gclient .gclient
53+ gclient sync
54+
55+ - name : Generate project for main branch
56+ shell : cmd
57+ run : |
58+ set "PATH=%CD%\..\depot_tools;%PATH%"
59+ set "DEPOT_TOOLS_WIN_TOOLCHAIN=0"
60+ cd baseline
61+ gn gen out\Release --args="webnn_enable_dml=true is_debug=false gpgmm_enable_device_checks=true"
62+
63+ - name : Build for main branch
64+ shell : cmd
65+ run : |
66+ set "PATH=%CD%\..\depot_tools;%PATH%"
67+ set "DEPOT_TOOLS_WIN_TOOLCHAIN=0"
68+ cd baseline
69+ ninja -C out\Release
70+
71+ - name : Run 'npm install' command under node folder of main branch
72+ shell : cmd
73+ run : |
74+ set "PATH=%CD%\..\depot_tools;%CD%\baseline\out\Release;%PATH%"
75+ cd baseline\node
76+ npm install --webnn_native_lib_path="../out/Release"
77+
78+ - name : Run 'npm run build' command under node folder of main branch
79+ shell : cmd
80+ run : |
81+ set "PATH=%CD%\..\depot_tools;%CD%\baseline\out\Release;%PATH%"
82+ cd baseline\node
83+ npm run build --webnn_native_lib_path="../out/Release"
84+
85+ - name : Run 'npm run report' command under node folder of main branch
86+ shell : cmd
87+ run : |
88+ set "PATH=%CD%\baseline\out\Release;%PATH%"
89+ cd baseline\node
90+ npm run report || true
91+
92+ - name : Prepare baseline result file for regression checking
93+ shell : cmd
94+ run : |
95+ echo "Baseline node test result:"
96+ type baseline\node\result.xml
97+ copy baseline\node\result.xml ${{ github.workspace }}\..\baseline.xml
98+ rmdir /s /q baseline
99+
100+ - uses : actions/checkout@v2
101+ with :
102+ path : update
103+ fetch-depth : 0
104+
105+ - name : Update DEPS for update branch
106+ shell : pwsh
107+ run : |
108+ cd update
109+ (Get-Content -path .\DEPS -Raw) -replace "'checkout_onnxruntime': True", "'checkout_onnxruntime': False" | Set-Content -path .\DEPS
110+ (Get-Content -path .\DEPS -Raw) -replace "'checkout_samples': True", "'checkout_samples': False" | Set-Content -path .\DEPS
111+
112+ - name : Sync latest code
113+ shell : cmd
114+ run : |
115+ set "PATH=%CD%\..\depot_tools;%PATH%"
116+ set "DEPOT_TOOLS_WIN_TOOLCHAIN=0"
117+ cd update
118+ copy scripts\standalone.gclient .gclient
119+ gclient sync
120+
121+ - name : Generate project for update branch
122+ shell : cmd
123+ run : |
124+ set "PATH=%CD%\..\depot_tools;%PATH%"
125+ set "DEPOT_TOOLS_WIN_TOOLCHAIN=0"
126+ cd update
127+ gn gen out\Release --args="webnn_enable_dml=true is_debug=false gpgmm_enable_device_checks=true"
128+
129+ - name : Build for update branch
130+ shell : cmd
131+ run : |
132+ set "PATH=%CD%\..\depot_tools;%PATH%"
133+ set "DEPOT_TOOLS_WIN_TOOLCHAIN=0"
134+ cd update
135+ ninja -C out\Release
136+
137+ - name : Run 'npm install' command under node folder of update branch
138+ shell : cmd
139+ run : |
140+ set "PATH=%CD%\..\depot_tools;%CD%\update\out\Release;%PATH%"
141+ cd update\node
142+ npm install --webnn_native_lib_path="../out/Release"
143+
144+ - name : Run 'npm run build' command under node folder of update branch
145+ shell : cmd
146+ run : |
147+ set "PATH=%CD%\..\depot_tools;%CD%\update\out\Release;%PATH%"
148+ cd update\node
149+ npm run build --webnn_native_lib_path="../out/Release"
150+
151+ - name : Run 'npm run report' command under node folder of update branch
152+ shell : cmd
153+ run : |
154+ set "PATH=%CD%\update\out\Release;%PATH%"
155+ cd update\node
156+ npm run report || true
157+
158+ - name : Prepare latest result file for regression checking
159+ shell : cmd
160+ run : |
161+ echo "Latest node test result:"
162+ type update\node\result.xml
163+ copy update\node\result.xml ${{ github.workspace }}\..\update.xml
164+
165+ - name : Regression check
166+ run : |
167+ echo "Regression checking..."
168+ python update\workflow_scripts\regression_check.py ${{ github.workspace }}\..\baseline.xml ${{ github.workspace }}\..\update.xml
0 commit comments