Skip to content

Commit ddface9

Browse files
committed
CI: Execute architectural tests
'make arch-test RISCV_DEVICE=Zifencei' is known to fail.
1 parent c4bbfda commit ddface9

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

.ci/common.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
GCC_REL=11.2-2022.02
2+
ARM_MIRROR=https://github.com/DLTcollab/toolchain-arm/raw/main
3+
4+
SOURCES=$(find $(git rev-parse --show-toplevel) | egrep "\.(cpp|h)\$" | egrep -v "gcc-arm-${GCC_REL}-x86_64-aarch64-none-linux-gnu|gcc-arm-${GCC_REL}-x86_64-arm-none-linux-gnueabihf")
5+
6+
# Expect host is Linux/x86_64
7+
check_platform()
8+
{
9+
MACHINE_TYPE=`uname -m`
10+
if [ ${MACHINE_TYPE} != 'x86_64' ]; then
11+
exit
12+
fi
13+
14+
OS_TYPE=`uname -s`
15+
if [ ${OS_TYPE} != 'Linux' ]; then
16+
exit
17+
fi
18+
}

.ci/riscv-tests.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
3+
. .ci/common.sh
4+
5+
check_platform
6+
7+
mkdir -p toolchain
8+
9+
# GNU Toolchain for RISC-V
10+
GCC_VER=12.2.0-1
11+
XPACK_REPO=https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download
12+
13+
set -x
14+
15+
wget -q \
16+
${XPACK_REPO}/v${GCC_VER}/xpack-riscv-none-elf-gcc-${GCC_VER}-linux-x64.tar.gz -O- \
17+
| tar -C toolchain -xz
18+
19+
export PATH=`pwd`/toolchain/xpack-riscv-none-elf-gcc-${GCC_VER}/bin:$PATH
20+
21+
make clean
22+
make arch-test RISCV_DEVICE=I || exit 1
23+
make arch-test RISCV_DEVICE=M || exit 1
24+
make arch-test RISCV_DEVICE=C || exit 1
25+
make arch-test RISCV_DEVICE=Zifencei || exit 1
26+
make arch-test RISCV_DEVICE=privilege || exit 1

.github/workflows/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ jobs:
2424
make distclean ENABLE_COMPUTED_GOTO=0 ENABLE_EXT_C=1
2525
make distclean ENABLE_GDBSTUB=0
2626
make distclean ENABLE_SDL=0
27+
- name: architectural test
28+
run: |
29+
sh .ci/riscv-tests.sh
30+
shell: bash
2731

2832
coding_style:
2933
runs-on: ubuntu-22.04

0 commit comments

Comments
 (0)