-
Notifications
You must be signed in to change notification settings - Fork 52
134 lines (123 loc) · 4.6 KB
/
build_sdk.yaml
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
name: Build SDK
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
paths:
- "Build/**"
- "application/**"
- "NMSIS/**"
- "OS/**"
- "SoC/**"
- "test/**"
- ".github/**"
- ".ci/**"
- "tools/**"
pull_request:
paths:
- "Build/**"
- "application/**"
- "NMSIS/**"
- "OS/**"
- "SoC/**"
- "test/**"
- ".github/**"
- ".ci/**"
- "tools/**"
jobs:
build:
name: Build SDK
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
soc: [evalsoc, gd32vf103, gd32vw55x]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Caching tools
uses: actions/cache@v3
with:
path: |
prebuilt_tools/*.tar.bz2
prebuilt_tools/*.zip
prebuilt_tools/*.tar.gz
key: build
- name: Prepare Tools for Ubuntu
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get -q update
sudo apt install -yq python3 python3-pip unzip libz-dev libssl-dev libglib2.0-dev libfdt-dev libpixman-1-dev zlib1g-dev libncursesw5-dev libncursesw5 libgmp-dev libmpfr-dev libmpc-dev
sudo python3 -m pip install -q --upgrade pip
# install to user local storage
# ERROR: Cannot uninstall 'pyserial'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
pip3 install -q -r tools/scripts/requirements.txt
mkdir -p prebuilt_tools
export TOOLVER=2024.06
cd prebuilt_tools
echo "Prepare Nuclei Toolchain......"
toolzip=nuclei_riscv_newlibc_prebuilt_linux64_${TOOLVER}.tar.bz2
if [ ! -e $toolzip ] ; then
echo "Download Nuclei toolchain now!"
wget --progress=dot:giga --no-check-certificate https://www.nucleisys.com/upload/files/toochain/gcc/$toolzip
ls -lh $toolzip
md5sum $toolzip
fi
tar -xjf $toolzip
echo "Prepare Nuclei QEMU......"
toolzip=nuclei-qemu-${TOOLVER}-linux-x64.tar.gz
if [ ! -e $toolzip ] ; then
echo "Download Nuclei qemu now!"
wget --progress=dot:giga --no-check-certificate https://www.nucleisys.com/upload/files/toochain/qemu/$toolzip
ls -lh $toolzip
md5sum $toolzip
fi
tar -xzf $toolzip
if [ -d linux_qemu ] ; then
mv linux_qemu qemu
fi
echo "Check gcc and qemu version"
ldd ./qemu/bin/qemu-system-riscv32
./qemu/bin/qemu-system-riscv32 --version
./gcc/bin/riscv64-unknown-elf-gcc -v
cd ..
echo "NUCLEI_TOOL_ROOT=$(pwd)/prebuilt_tools" > setup_config.sh
- name: Build and Run SDK for Nuclei Eval SoC
if: matrix.soc == 'evalsoc'
run: |
echo "Setup build environment"
source setup.sh
export APPCFG=tools/scripts/nsdk_cli/configs/application.json
for hwcfg in "nuclei_fpga_eval_ci_qemu_small_gnu" "nuclei_fpga_eval_ci_qemu_small_llvm" ; do
export HWCFG=tools/scripts/nsdk_cli/configs/${hwcfg}.json
export LOGDIR=logs/${hwcfg}
echo "Build and run for ${hwcfg}"
python3 tools/scripts/nsdk_cli/nsdk_bench.py --appcfg $APPCFG --hwcfg $HWCFG --parallel="-j" --logdir $LOGDIR --run_target qemu --run
done
- name: Build SDK for GD32VF103 SoC
if: matrix.soc == 'gd32vf103'
run: |
echo "Setup build environment"
source setup.sh
export APPCFG=tools/scripts/nsdk_cli/configs/application.json
export HWCFG=tools/scripts/nsdk_cli/configs/gd32vf103v_rvstar.json
export LOGDIR=logs/gd32vf103v_rvstar
python3 tools/scripts/nsdk_cli/nsdk_bench.py --appcfg $APPCFG --hwcfg $HWCFG --parallel="-j" --logdir $LOGDIR
- name: Build SDK for GD32VW55X SoC
if: matrix.soc == 'gd32vw55x'
run: |
echo "Setup build environment"
source setup.sh
export APPCFG=tools/scripts/nsdk_cli/configs/application.json
export HWCFG=tools/scripts/nsdk_cli/configs/gd32vw55h_eval.json
export LOGDIR=logs/gd32vw55h_eval
python3 tools/scripts/nsdk_cli/nsdk_bench.py --appcfg $APPCFG --hwcfg $HWCFG --parallel="-j" --logdir $LOGDIR
- name: Upload Build Log for ${{ matrix.soc }}
uses: actions/upload-artifact@v3
with:
name: build_${{ matrix.soc }}
path: |
logs/*