-
-
Notifications
You must be signed in to change notification settings - Fork 12
320 lines (253 loc) · 10.6 KB
/
BuildAndTest.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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
name: ChiselStage
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master, develop, bump/mill_chisel5 ]
# pull_request:
# branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
chiselStage:
# The type of runner that the job will run on
runs-on: [self-hosted, Linux, X64]
name: chiselStage
container:
image: whutddk/rift2env:chisel5
# needs: clean
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: set up apt
run: |
apt-get update
apt-get install -y wget git make curl
- uses: actions/[email protected]
with:
submodules: 'recursive'
# - name: Set up JDK 17
# uses: actions/[email protected]
# with:
# java-version: '17'
# distribution: 'microsoft'
- name: Compile
run: |
echo ${GITHUB_WORKSPACE}
rm dependencies/rocket-chip/src/main/resources/META-INF/services/firrtl.options.RegisteredLibrary
mill -i rift2Core[chisel].test.runMain test.testAll
mill --no-server show rift2Core[chisel].docJar
unzip -d ScalaDoc/ out/rift2Core/chisel/docJar.dest/out.jar
echo $GITHUB_REF_NAME
mkdir -p ${GITHUB_WORKSPACE}/../ScalaDoc/
mkdir -p ${GITHUB_WORKSPACE}/../ScalaDoc/$GITHUB_REF_NAME/
cd ${GITHUB_WORKSPACE}
cp ${GITHUB_WORKSPACE}/LICENSE.Apache ${GITHUB_WORKSPACE}/../
cp ${GITHUB_WORKSPACE}/LICENSE.NPL ${GITHUB_WORKSPACE}/../
cp -R ScalaDoc/* ${GITHUB_WORKSPACE}/../ScalaDoc/$GITHUB_REF_NAME
# cd ${GITHUB_WORKSPACE}/generated/Release/
# tar -cvf Rift2300-Release.tar Rift2300/*
# tar -cvf Rift2310-Release.tar Rift2310/*
# tar -cvf Rift2320-Release.tar Rift2320/*
# tar -cvf Rift2330-Release.tar Rift2330/*
# tar -cvf Rift2340-Release.tar Rift2340/*
# tar -cvf Rift2350-Release.tar Rift2350/*
# tar -cvf Rift2360-Release.tar Rift2360/*
# tar -cvf Rift2370-Release.tar Rift2370/*
# tar -cvf Rift2380-Release.tar Rift2380/*
# tar -cvf Rift2390-Release.tar Rift2390/*
cd ${GITHUB_WORKSPACE}/generated/Debug/
tar -cvf Rift2300-Debug.tar Rift2300/*
tar -cvf Rift2310-Debug.tar Rift2310/*
tar -cvf Rift2320-Debug.tar Rift2320/*
tar -cvf Rift2330-Debug.tar Rift2330/*
tar -cvf Rift2340-Debug.tar Rift2340/*
tar -cvf Rift2350-Debug.tar Rift2350/*
tar -cvf Rift2360-Debug.tar Rift2360/*
tar -cvf Rift2370-Debug.tar Rift2370/*
tar -cvf Rift2380-Debug.tar Rift2380/*
tar -cvf Rift2390-Debug.tar Rift2390/*
- name: Commit
run: |
cd ${GITHUB_WORKSPACE}
git config --global --add safe.directory ${GITHUB_WORKSPACE}
git checkout -- .
git fetch origin gh_pages
git checkout gh_pages
rm -rf ${GITHUB_WORKSPACE}/ScalaDoc/$GITHUB_REF_NAME
cp -R ${GITHUB_WORKSPACE}/../ScalaDoc/* ${GITHUB_WORKSPACE}/ScalaDoc/
cp ${GITHUB_WORKSPACE}/../LICENSE.Apache ${GITHUB_WORKSPACE}/
cp ${GITHUB_WORKSPACE}/../LICENSE.NPL ${GITHUB_WORKSPACE}/
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add ./ScalaDoc
git commit --no-gpg-sign --allow-empty -m "update ci result"
- name: push
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh_pages
force: false
- name: Get current time
id: gettime
run: |
echo "::set-output name=time::$(date +'%Y-%m-%d-%H-%M-%S')"
#echo "NOW::$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV
- name: Create Pre-Release and Upload Release Asset
if: github.ref_name != 'master'
uses: softprops/action-gh-release@v1
with:
tag_name: PreRelease-${{ steps.gettime.outputs.time }}
name: PreRelease-${{ steps.gettime.outputs.time }}
body: CI compile on ${{ steps.gettime.outputs.time }}.
draft: false
prerelease: true
target_commitish: ${{github.ref_name}}
files: |
# ./generated/Release/Rift2300-Release.tar
./generated/Debug/Rift2300-Debug.tar
# ./generated/Release/Rift2310-Release.tar
./generated/Debug/Rift2310-Debug.tar
# ./generated/Release/Rift2320-Release.tar
./generated/Debug/Rift2320-Debug.tar
# ./generated/Release/Rift2330-Release.tar
./generated/Debug/Rift2330-Debug.tar
# ./generated/Release/Rift2340-Release.tar
./generated/Debug/Rift2340-Debug.tar
# ./generated/Release/Rift2350-Release.tar
./generated/Debug/Rift2350-Debug.tar
# ./generated/Release/Rift2360-Release.tar
./generated/Debug/Rift2360-Debug.tar
# ./generated/Release/Rift2370-Release.tar
./generated/Debug/Rift2370-Debug.tar
# ./generated/Release/Rift2380-Release.tar
./generated/Debug/Rift2380-Debug.tar
# ./generated/Release/Rift2390-Release.tar
./generated/Debug/Rift2390-Debug.tar
./LICENSE.Apache
./LICENSE.NPL
- name: Create Release and Upload Release Asset
if: github.ref_name == 'master'
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.gettime.outputs.time }}
name: Release-${{ steps.gettime.outputs.time }}
body: CI compile on ${{ steps.gettime.outputs.time }}.
draft: false
prerelease: false
target_commitish: ${{github.ref_name}}
files: |
# ./generated/Release/Rift2300-Release.tar
./generated/Debug/Rift2300-Debug.tar
# ./generated/Release/Rift2310-Release.tar
./generated/Debug/Rift2310-Debug.tar
# ./generated/Release/Rift2320-Release.tar
./generated/Debug/Rift2320-Debug.tar
# ./generated/Release/Rift2330-Release.tar
./generated/Debug/Rift2330-Debug.tar
# ./generated/Release/Rift2340-Release.tar
./generated/Debug/Rift2340-Debug.tar
# ./generated/Release/Rift2350-Release.tar
./generated/Debug/Rift2350-Debug.tar
# ./generated/Release/Rift2360-Release.tar
./generated/Debug/Rift2360-Debug.tar
# ./generated/Release/Rift2370-Release.tar
./generated/Debug/Rift2370-Debug.tar
# ./generated/Release/Rift2380-Release.tar
./generated/Debug/Rift2380-Debug.tar
# ./generated/Release/Rift2390-Release.tar
./generated/Debug/Rift2390-Debug.tar
./LICENSE.Apache
./LICENSE.NPL
# Runs a single command using the runners shell
# - name: Run a one-line script
# run: echo Hello, world!
# Runs a set of commands using the runners shell
# - name: Run a multi-line script
# run: |
# echo Add other actions to build,
# echo test, and deploy your project.
rift23x0CI:
name: rift23x0 CI
needs: chiselStage
strategy:
fail-fast: false
matrix:
version: [Rift2330, Rift2340, Rift2350, Rift2360, Rift2370, Rift2380, Rift2390]
runs-on: [self-hosted, Linux, X64]
container:
image: whutddk/rift2env:riscvtest
# services:
# testDocker:
# image: whutddk/rift2env:riscvtest
steps:
- name: set up apt
run: |
apt-get update
apt-get install -y wget git make g++ ccache zlib1g zlib1g-dev
- name: Checkout Github Page
run: |
cd /
git clone https://github.com/whutddk/Rift2Core.git
cd Rift2Core
pwd
git fetch --all
git checkout ${{ github.ref_name }}
git checkout gh_pages
git pull
- name: Get Release
id: getrelease
uses: cardinalby/[email protected]
with:
latest: true
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check Release
run: |
echo ${{ steps.getrelease.outputs.tag_name }}
- name: Download Latest Pkg
run: |
cd /Rift2Core
wget https://github.com/whutddk/Rift2Core/releases/download/${{ steps.getrelease.outputs.tag_name }}/${{matrix.version}}-Debug.tar
# wget https://github.com/whutddk/Rift2Core/releases/download/${{ steps.getrelease.outputs.tag_name }}/${{matrix.version}}-Release.tar
- name: Unzip files
run: |
cd /Rift2Core
mkdir -p ./generated/Debug
# mkdir -p ./generated/Release
tar -xvf ./${{matrix.version}}-Debug.tar -C ./generated/Debug
# tar -xvf ./${{matrix.version}}-Release.tar -C ./generated/Release
- name: Checkout Env
run: |
cd /Rift2Core
mkdir -p ./tb/ci
cp /test/* ./tb/ci
git restore -s ${{ github.ref_name }} -- ./tb
git restore -s ${{ github.ref_name }} -- ./Makefile
# git restore -s ${{ github.ref_name }} -- ./src/yosys/area.ys
- name: isa, dhrystone, coremark, yosys
run: |
cd /Rift2Core
export R2=/Rift2Core
rm -f /Rift2Core/generated/Debug/${{matrix.version}}/isa.json
echo "{\n \"schemaVersion\": 1, \n \"label\": \"\", \n \"message\": \"Failed\", \n \"color\": \"red\" \n}" >> /Rift2Core/generated/Debug/${{matrix.version}}/isa.json
make test CONFIG=/Debug/${{matrix.version}}/
# make area CONFIG=/Release/${{matrix.version}}/
- name: commit result
if: success() || failure()
run: |
cd /Rift2Core
git pull
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add ./generated/Debug/${{matrix.version}}/*.json
git commit --no-gpg-sign --allow-empty -m "ci update ${{matrix.version}}"
# git add ./generated/Release/${{matrix.version}}/area.json
- name: push
if: success() || failure()
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh_pages
directory: /Rift2Core
force: false