1
+ # Copyright © 2019-2023
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ # http://www.apache.org/licenses/LICENSE-2.0
7
+ #
8
+ # Unless required by applicable law or agreed to in writing, software
9
+ # distributed under the License is distributed on an "AS IS" BASIS,
10
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ # See the License for the specific language governing permissions and
12
+ # limitations under the License.
13
+
14
+ name : CI
15
+
16
+ on : [push, pull_request]
17
+
18
+ jobs :
19
+ setup :
20
+ runs-on : ubuntu-20.04
21
+
22
+ steps :
23
+ - name : Checkout code
24
+ uses : actions/checkout@v2
25
+ with :
26
+ submodules : recursive
27
+
28
+ - name : Cache Toolchain Directory
29
+ id : cache-toolchain
30
+ uses : actions/cache@v2
31
+ with :
32
+ path : tools
33
+ key : ${{ runner.os }}-toolchain-v0.1
34
+ restore-keys : |
35
+ ${{ runner.os }}-toolchain-
36
+
37
+ - name : Cache Third Party Directory
38
+ id : cache-thirdparty
39
+ uses : actions/cache@v2
40
+ with :
41
+ path : third_party
42
+ key : ${{ runner.os }}-thirdparty-v0.1
43
+ restore-keys : |
44
+ ${{ runner.os }}-thirdparty-
45
+
46
+ - name : Install Dependencies
47
+ if : steps.cache-toolchain.outputs.cache-hit != 'true' || steps.cache-thirdparty.outputs.cache-hit != 'true'
48
+ run : |
49
+ sudo bash ./ci/system_updates.sh
50
+
51
+ - name : Setup Toolchain
52
+ if : steps.cache-toolchain.outputs.cache-hit != 'true'
53
+ run : |
54
+ TOOLDIR=$PWD/tools
55
+ mkdir -p build
56
+ cd build
57
+ ../configure --tooldir=$TOOLDIR
58
+ ci/toolchain_install.sh --all
59
+
60
+ - name : Setup Third Party
61
+ if : steps.cache-thirdparty.outputs.cache-hit != 'true'
62
+ run : |
63
+ make -C third_party > /dev/null
64
+
65
+ # build:
66
+ # runs-on: ubuntu-20.04
67
+ # needs: setup
68
+ # strategy:
69
+ # matrix:
70
+ # xlen: [32, 64]
71
+
72
+ # steps:
73
+ # - name: Checkout code
74
+ # uses: actions/checkout@v2
75
+
76
+ # - name: Install Dependencies
77
+ # run: |
78
+ # sudo bash ./ci/system_updates.sh
79
+
80
+ # - name: Cache Toolchain Directory
81
+ # id: cache-toolchain
82
+ # uses: actions/cache@v2
83
+ # with:
84
+ # path: tools
85
+ # key: ${{ runner.os }}-toolchain-v0.1
86
+ # restore-keys: |
87
+ # ${{ runner.os }}-toolchain-
88
+
89
+ # - name: Cache Third Party Directory
90
+ # id: cache-thirdparty
91
+ # uses: actions/cache@v2
92
+ # with:
93
+ # path: third_party
94
+ # key: ${{ runner.os }}-thirdparty-v0.1
95
+ # restore-keys: |
96
+ # ${{ runner.os }}-thirdparty-
97
+
98
+ # - name: Run Build
99
+ # run: |
100
+ # TOOLDIR=$PWD/tools
101
+ # mkdir -p build${{ matrix.xlen }}
102
+ # cd build${{ matrix.xlen }}
103
+ # ../configure --tooldir=$TOOLDIR --xlen=${{ matrix.xlen }}
104
+ # source ci/toolchain_env.sh
105
+ # make software -s > /dev/null
106
+ # make tests -s > /dev/null
107
+
108
+ # - name: Upload Build Artifact
109
+ # uses: actions/upload-artifact@v2
110
+ # with:
111
+ # name: build-${{ matrix.xlen }}
112
+ # path: build${{ matrix.xlen }}
113
+
114
+ # tests:
115
+ # runs-on: ubuntu-20.04
116
+ # needs: build
117
+ # strategy:
118
+ # matrix:
119
+ # name: [regression, opencl, config1, config2, debug, stress]
120
+ # xlen: [32, 64]
121
+
122
+ # steps:
123
+ # - name: Checkout code
124
+ # uses: actions/checkout@v2
125
+
126
+ # - name: Install Dependencies
127
+ # run: |
128
+ # sudo bash ./ci/system_updates.sh
129
+
130
+ # - name: Cache Toolchain Directory
131
+ # id: cache-toolchain
132
+ # uses: actions/cache@v2
133
+ # with:
134
+ # path: tools
135
+ # key: ${{ runner.os }}-toolchain-v0.1
136
+ # restore-keys: |
137
+ # ${{ runner.os }}-toolchain-
138
+
139
+ # - name: Cache Third Party Directory
140
+ # id: cache-thirdparty
141
+ # uses: actions/cache@v2
142
+ # with:
143
+ # path: third_party
144
+ # key: ${{ runner.os }}-thirdparty-v0.1
145
+ # restore-keys: |
146
+ # ${{ runner.os }}-thirdparty-
147
+
148
+ # - name: Download Build Artifact
149
+ # uses: actions/download-artifact@v2
150
+ # with:
151
+ # name: build-${{ matrix.xlen }}
152
+ # path: build${{ matrix.xlen }}
153
+
154
+ # - name: Run tests
155
+ # run: |
156
+ # cd build${{ matrix.xlen }}
157
+ # source ci/toolchain_env.sh
158
+ # chmod -R +x . # Ensure all files have executable permissions
159
+ # if [ "${{ matrix.name }}" == "regression" ]; then
160
+ # ./ci/regression.sh --unittest
161
+ # ./ci/regression.sh --isa
162
+ # ./ci/regression.sh --kernel
163
+ # ./ci/regression.sh --synthesis
164
+ # ./ci/regression.sh --regression
165
+ # else
166
+ # ./ci/regression.sh --${{ matrix.name }}
167
+ # fi
168
+
169
+ build_vm :
170
+ runs-on : ubuntu-20.04
171
+ needs : setup
172
+ strategy :
173
+ matrix :
174
+ xlen : [32, 64]
175
+
176
+ steps :
177
+ - name : Checkout code
178
+ uses : actions/checkout@v2
179
+
180
+ - name : Install Dependencies
181
+ run : |
182
+ sudo bash ./ci/system_updates.sh
183
+
184
+ - name : Cache Toolchain Directory
185
+ id : cache-toolchain
186
+ uses : actions/cache@v2
187
+ with :
188
+ path : tools
189
+ key : ${{ runner.os }}-toolchain-v0.1
190
+ restore-keys : |
191
+ ${{ runner.os }}-toolchain-
192
+
193
+ - name : Cache Third Party Directory
194
+ id : cache-thirdparty
195
+ uses : actions/cache@v2
196
+ with :
197
+ path : third_party
198
+ key : ${{ runner.os }}-thirdparty-v0.1
199
+ restore-keys : |
200
+ ${{ runner.os }}-thirdparty-
201
+
202
+ - name : Run Build
203
+ run : |
204
+ TOOLDIR=$PWD/tools
205
+ mkdir -p build${{ matrix.xlen }}-vm
206
+ cd build${{ matrix.xlen }}-vm
207
+ ../configure --tooldir=$TOOLDIR --xlen=${{ matrix.xlen }} --vm_enable=1
208
+ source ci/toolchain_env.sh
209
+ make software -s > /dev/null
210
+ make tests -s > /dev/null
211
+
212
+ - name : Upload Build Artifact
213
+ uses : actions/upload-artifact@v2
214
+ with :
215
+ name : build-${{ matrix.xlen }}-vm
216
+ path : build${{ matrix.xlen }}-vm
217
+
218
+ test_vm :
219
+ runs-on : ubuntu-20.04
220
+ needs : build_vm
221
+ strategy :
222
+ matrix :
223
+ xlen : [32, 64]
224
+
225
+ steps :
226
+ - name : Checkout code
227
+ uses : actions/checkout@v2
228
+
229
+ - name : Install Dependencies
230
+ run : |
231
+ sudo bash ./ci/system_updates.sh
232
+
233
+ - name : Cache Toolchain Directory
234
+ id : cache-toolchain
235
+ uses : actions/cache@v2
236
+ with :
237
+ path : tools
238
+ key : ${{ runner.os }}-toolchain-v0.1
239
+ restore-keys : |
240
+ ${{ runner.os }}-toolchain-
241
+
242
+ - name : Cache Third Party Directory
243
+ id : cache-thirdparty
244
+ uses : actions/cache@v2
245
+ with :
246
+ path : third_party
247
+ key : ${{ runner.os }}-thirdparty-v0.1
248
+ restore-keys : |
249
+ ${{ runner.os }}-thirdparty-
250
+
251
+ - name : Download Build Artifact
252
+ uses : actions/download-artifact@v2
253
+ with :
254
+ name : build-${{ matrix.xlen }}-vm
255
+ path : build${{ matrix.xlen }}-vm
256
+
257
+ - name : Run tests
258
+ run : |
259
+ cd build${{ matrix.xlen }}-vm
260
+ source ci/toolchain_env.sh
261
+ chmod -R +x . # Ensure all files have executable permissions
262
+ ./ci/regression.sh --vm
263
+
264
+ complete :
265
+ runs-on : ubuntu-20.04
266
+ needs : test_vm
267
+
268
+ steps :
269
+ - name : Check Completion
270
+ run : echo "All matrix jobs passed"
0 commit comments