From 7502a19207f36b185547ea005c6eba85de0f4324 Mon Sep 17 00:00:00 2001 From: "-T.K.-" Date: Tue, 15 Oct 2024 10:31:43 -0700 Subject: [PATCH] ADD: try to add CI for RISCV --- .github/workflows/run-tests.yaml | 37 ++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index 40c4e03..ab4de30 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -24,11 +24,44 @@ jobs: rm -rf ./build/ - name: Configure CMake run: | - cmake . -S ./ -B ./build/ -D CMAKE_BUILD_TYPE=Debug + cmake -S ./ -B ./build/ -D CMAKE_BUILD_TYPE=Debug - name: Build run: | cmake --build ./build/ --target tests ./build/tests/tests - name: Run binary run: | - ./build/tests/tests \ No newline at end of file + ./build/tests/tests + + build-riscv: + defaults: + run: + shell: bash -l {0} + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Set up toolchain + run: | + wget https://github.com/ucb-bar/RISC-V-Ready-To-Run/releases/download/v2024.06.04/riscv64-unknown-toolchain.tar.xz + tar -xf riscv64-unknown-toolchain.tar.xz + wget https://github.com/ucb-bar/RISC-V-Ready-To-Run/releases/download/v2024.06.04/spike -O $GITHUB_WORKSPACE/riscv64-unknown-toolchain/bin/spike + chmod +x $GITHUB_WORKSPACE/riscv64-unknown-toolchain/bin/spike + echo "RISCV=$GITHUB_WORKSPACE/riscv64-unknown-toolchain" >> $GITHUB_ENV + echo "$GITHUB_WORKSPACE/riscv64-unknown-toolchain/bin" >> $GITHUB_PATH + - name: Clean previous builds + run: | + rm -rf ./build/ + - name: Configure CMake + run: | + cmake -S ./ -B ./build/ -D CMAKE_BUILD_TYPE=Debug -D CMAKE_TOOLCHAIN_FILE=./riscv-gcc.cmake + - name: Build + run: | + cmake --build ./build/ --target tests + - name: Run binary + run: | + cmake --build ./build/ --target run_tests