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