@@ -31,27 +31,28 @@ jobs:
3131
3232 steps :
3333 - name : Checkout repository
34- uses : actions/checkout@v3
34+ uses : actions/checkout@v4
3535
3636 - name : install build deps
3737 run : |
3838 sudo apt-get update
3939 sudo apt-get install autoconf automake autotools-dev ninja-build make ccache \
40- gcc-${{ matrix.apt_triple }} gfortran-${{ matrix.apt_triple }} libgomp1-riscv64-cross
40+ gcc-${{ matrix.apt_triple }} gfortran-${{ matrix.apt_triple }} libgomp1-riscv64-cross libglib2.0-dev
4141
4242 - name : checkout qemu
43- uses : actions/checkout@v3
43+ uses : actions/checkout@v4
4444 with :
45- repository : T-head-Semi /qemu
45+ repository : XUANTIE-RV /qemu
4646 path : qemu
47- ref : 1e692ebb43d396c52352406323fc782c1ac99a42
47+ ref : e0ace167effcd36d1f82c7ccb4522b3126011479 # xuantie-qemu-9.0
4848
4949 - name : build qemu
5050 run : |
5151 # Force use c910v qemu-user
52- wget https://github.com/revyos/qemu/commit/5164bca5a4bcde4534dc1a9aa3a7f619719874cf .patch
52+ wget https://github.com/revyos/qemu/commit/222729c7455784dd855216d7a2bec4bd8f2a6800 .patch
5353 cd qemu
54- patch -p1 < ../5164bca5a4bcde4534dc1a9aa3a7f619719874cf.patch
54+ patch -p1 < ../222729c7455784dd855216d7a2bec4bd8f2a6800.patch
55+ export CXXFLAGS="-Wno-error"; export CFLAGS="-Wno-error"
5556 ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=riscv64-linux-user --disable-system
5657 make -j$(nproc)
5758 make install
8283
8384 - name : test
8485 run : |
85- export PATH=$GITHUB_WORKSPACE/qemu-install/bin/:$PATH
86- qemu-riscv64 ./utest/openblas_utest
87- qemu-riscv64 ./utest/openblas_utest_ext
86+ run_with_retry() {
87+ local cmd="$1"
88+ local time_out=10
89+ local retries=10
90+ local attempt=0
91+
92+ for ((i=1; i<=retries; i++)); do
93+ attempt=$((i))
94+ if timeout -s 12 --preserve-status $time_out $cmd; then
95+ echo "Command succeeded on attempt $i."
96+ return 0
97+ else
98+ local exit_code=$?
99+ if [ $exit_code -eq 140 ]; then
100+ echo "Attempt $i timed out (retrying...)"
101+ time_out=$((time_out + 5))
102+ else
103+ echo "Attempt $i failed with exit code $exit_code. Aborting workflow."
104+ exit $exit_code
105+ fi
106+ fi
107+ done
108+ echo "All $retries attempts failed, giving up."
109+ echo "Final failure was due to timeout."
110+ echo "Aborting workflow."
111+ exit $exit_code
112+ }
113+ export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
114+ which qemu-riscv64
115+ export QEMU_BIN=$(which qemu-riscv64)
116+ run_with_retry "$QEMU_BIN ./utest/openblas_utest"
117+ run_with_retry "$QEMU_BIN ./utest/openblas_utest_ext"
118+
88119 OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./ctest/xscblat1
89120 OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./ctest/xdcblat1
90121 OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./ctest/xccblat1
0 commit comments