Skip to content

Commit fe57ec5

Browse files
authored
Merge pull request #2096 from riscv-software-src/remove-ci-tarball
Remove CI tarball; build tests in CI
2 parents 38eec3f + e360efb commit fe57ec5

File tree

7 files changed

+56
-64
lines changed

7 files changed

+56
-64
lines changed

.github/workflows/apt-packages.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
build-essential
22
device-tree-compiler
3+
g++-riscv64-linux-gnu
4+
libc6-dev-riscv64-cross

.github/workflows/continuous-integration.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ on:
1818
jobs:
1919
test:
2020
name: Test Spike build (Ubuntu)
21-
runs-on: ubuntu-22.04
21+
runs-on: ubuntu-24.04
2222
steps:
2323
- uses: actions/checkout@v2
2424
with:
@@ -53,5 +53,4 @@ jobs:
5353
git checkout $commit
5454
echo "Checking commit $commit"
5555
ci-tests/build-spike
56-
ci-tests/test-spike
5756
done

.github/workflows/debug-smoke.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
jobs:
1414
test:
1515
name: Test debug (Ubuntu)
16-
runs-on: ubuntu-22.04
16+
runs-on: ubuntu-24.04
1717
steps:
1818
- uses: actions/checkout@v2
1919

@@ -55,10 +55,10 @@ jobs:
5555
./gdbserver.py targets/RISC-V/spike32.py --print-failures \
5656
--gcc $GITHUB_WORKSPACE/xpack-riscv-none-elf-gcc-12.2.0-1/bin/riscv-none-elf-gcc \
5757
--gdb $GITHUB_WORKSPACE/xpack-riscv-none-elf-gcc-12.2.0-1/bin/riscv-none-elf-gdb \
58-
--sim_cmd $GITHUB_WORKSPACE/build/install/bin/spike \
58+
--sim_cmd $GITHUB_WORKSPACE/install/bin/spike \
5959
--server_cmd $GITHUB_WORKSPACE/riscv-openocd/src/openocd
6060
./gdbserver.py targets/RISC-V/spike64-2.py --print-failures \
6161
--gcc $GITHUB_WORKSPACE/xpack-riscv-none-elf-gcc-12.2.0-1/bin/riscv-none-elf-gcc \
6262
--gdb $GITHUB_WORKSPACE/xpack-riscv-none-elf-gcc-12.2.0-1/bin/riscv-none-elf-gdb \
63-
--sim_cmd $GITHUB_WORKSPACE/build/install/bin/spike \
63+
--sim_cmd $GITHUB_WORKSPACE/install/bin/spike \
6464
--server_cmd $GITHUB_WORKSPACE/riscv-openocd/src/openocd

ci-tests/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/install
2+
/build
3+
/run

ci-tests/build-spike

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
#!/bin/bash
22
set -e
33

4-
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
4+
ROOT=`git rev-parse --show-toplevel`
5+
NPROCS="$(nproc 2> /dev/null || sysctl -n hw.ncpu)"
6+
HERE=`pwd`
7+
CI="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
8+
INSTALL=$HERE/install
9+
BUILD=$HERE/build
510

6-
rm -rf build
11+
rm -rf $INSTALL $BUILD
12+
mkdir $INSTALL $BUILD
713

8-
mkdir build
9-
cd build
10-
mkdir install
14+
# build spike
15+
mkdir $BUILD/spike
16+
cd $BUILD/spike
1117
CFLAGS="-Werror -Wall -Wextra -Wvla"
1218
CXXFLAGS="-Wnon-virtual-dtor $CFLAGS"
13-
CXXFLAGS="$CXXFLAGS" CFLAGS="$CFLAGS" $DIR/../configure --prefix=`pwd`/install
14-
make -j"$(nproc 2> /dev/null || sysctl -n hw.ncpu)"
19+
CXXFLAGS="$CXXFLAGS" CFLAGS="$CFLAGS" $ROOT/configure --prefix=$INSTALL
20+
make -j$NPROCS
1521
make check
1622
make install install-hdrs-list.h
1723

1824
# check that help message prints without error
19-
install/bin/spike -h
25+
$INSTALL/bin/spike -h

ci-tests/create-ci-binary-tarball

Lines changed: 0 additions & 35 deletions
This file was deleted.

ci-tests/test-spike

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,43 @@
11
#!/bin/bash
22
set -e
33

4-
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
4+
ROOT=`git rev-parse --show-toplevel`
5+
NPROCS="$(nproc 2> /dev/null || sysctl -n hw.ncpu)"
6+
HERE=`pwd`
7+
CI="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
8+
INSTALL=$HERE/install
9+
BUILD=$HERE/build
10+
RUN=$HERE/run
511

6-
cd build
12+
# build pk
13+
rm -rf $BUILD/pk
14+
mkdir $BUILD/pk
15+
cd $BUILD/pk
16+
git clone https://github.com/riscv-software-src/riscv-pk.git
17+
riscv-pk/configure --host=riscv64-linux-gnu --prefix=$INSTALL
18+
make -j$NPROCS
19+
make install
720

8-
# run a program and check for correct output
9-
mkdir run
10-
cd run
11-
wget https://github.com/riscv-software-src/riscv-isa-sim/releases/download/dummy-tag-for-ci-storage/spike-ci.tar
12-
tar xf spike-ci.tar
13-
time ../install/bin/spike --isa=rv64gc pk hello | grep "Hello, world! Pi is approximately 3.141588."
14-
../install/bin/spike --log-commits --isa=rv64gc pk atomics 2> /dev/null | grep "First atomic counter is 1000, second is 100"
21+
# build tests
22+
rm -rf $RUN
23+
mkdir $RUN
24+
cd $RUN
25+
riscv64-linux-gnu-gcc -static -O2 -o hello $CI/hello.c
26+
riscv64-linux-gnu-gcc -static -O2 -o dummy-slliuw $CI/dummy-slliuw.c
27+
riscv64-linux-gnu-gcc -static -O2 -o customcsr $CI/customcsr.c
28+
riscv64-linux-gnu-gcc -static -O2 -o atomics $CI/atomics.c
1529

1630
# check that including sim.h in an external project works
17-
g++ -std=c++2a -I../install/include -L../install/lib $DIR/testlib.cc -lriscv -o test-libriscv
18-
g++ -std=c++2a -I../install/include -L../install/lib $DIR/test-customext.cc -lriscv -o test-customext
19-
g++ -std=c++2a -I../install/include -L../install/lib $DIR/custom-csr.cc -lriscv -o test-custom-csr
31+
g++ -std=c++2a -I$INSTALL/include -L$INSTALL/lib $CI/testlib.cc -lriscv -o test-libriscv
32+
g++ -std=c++2a -I$INSTALL/include -L$INSTALL/lib $CI/test-customext.cc -lriscv -o test-customext
33+
g++ -std=c++2a -I$INSTALL/include -L$INSTALL/lib $CI/custom-csr.cc -lriscv -o test-custom-csr
2034

2135
# check that all installed headers are functional
22-
g++ -std=c++2a -I../install/include -L../install/lib $DIR/testlib.cc -lriscv -o /dev/null -include ../install-hdrs-list.h
36+
g++ -std=c++2a -I$INSTALL/include -L$INSTALL/lib $CI/testlib.cc -lriscv -o /dev/null -include $BUILD/spike/install-hdrs-list.h
2337

24-
LD_LIBRARY_PATH=../install/lib ./test-libriscv pk hello| grep "Hello, world! Pi is approximately 3.141588."
25-
LD_LIBRARY_PATH=../install/lib ./test-customext pk dummy-slliuw | grep "Executed successfully"
26-
LD_LIBRARY_PATH=../install/lib ./test-custom-csr pk customcsr | grep "Executed successfully"
38+
# run tests
39+
time $INSTALL/bin/spike --isa=rv64gc $BUILD/pk/pk hello | grep "Hello, world! Pi is approximately 3.141588."
40+
$INSTALL/bin/spike --log-commits --isa=rv64gc $BUILD/pk/pk atomics 2> /dev/null | grep "First atomic counter is 1000, second is 100"
41+
LD_LIBRARY_PATH=$INSTALL/lib ./test-libriscv $BUILD/pk/pk hello | grep "Hello, world! Pi is approximately 3.141588."
42+
LD_LIBRARY_PATH=$INSTALL/lib ./test-customext $BUILD/pk/pk dummy-slliuw | grep "Executed successfully"
43+
LD_LIBRARY_PATH=$INSTALL/lib ./test-custom-csr $BUILD/pk/pk customcsr | grep "Executed successfully"

0 commit comments

Comments
 (0)