Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CMake

on:
push:
branches: [ riscv, main ]
branches: [ main ]
pull_request:
branches: [ main ]

Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
#run: ctest -V -C ${{env.BUILD_TYPE}}
run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure
run: ctest --parallel $(nproc) -C ${{env.BUILD_TYPE}} --output-on-failure

- name: Rerun failed tests
if: failure()
Expand Down
74 changes: 74 additions & 0 deletions .github/workflows/riscv-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: RISC-V Tests

on:
push:
branches: [ main, riscv-tests ]
pull_request:
branches: [ main ]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release

jobs:
riscv-tests:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Generate cache key
id: cache-key
run: |
echo "key=riscv-tests-${{ hashFiles('**/*.cpp', '**/*.h', '**/*.c', '**/CMakeLists.txt') }}" >> $GITHUB_OUTPUT

- name: Restore build cache
id: cache-build
uses: actions/cache@v4
with:
path: build
key: ${{ runner.os }}-riscv-tests-${{ steps.cache-key.outputs.key }}
restore-keys:
${{ runner.os }}-riscv-tests-

- name: Setup runtime dependencies and RISC-V toolchain
run: |
sudo apt update
sudo apt install -y --no-install-recommends qemu-user-static libc6-dev-riscv64-cross libstdc++6-riscv64-cross libgcc-s1-riscv64-cross \
cmake ninja-build gcc-riscv64-linux-gnu g++-riscv64-linux-gnu parallel

- name: Configure and Build for RISC-V
if: steps.cache-build.outputs.cache-hit != 'true'
run: |
mkdir -p build
cmake -G Ninja -B build cmake -B build \
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-DUNIVRSL_BUILD_CI=ON \
-DCMAKE_SYSTEM_NAME=Linux \
-DCMAKE_SYSTEM_PROCESSOR=riscv64 \
-DCMAKE_C_COMPILER=riscv64-linux-gnu-gcc \
-DCMAKE_CXX_COMPILER=riscv64-linux-gnu-g++ \
-DCMAKE_FIND_ROOT_PATH=/usr/riscv64-linux-gnu \
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY \
-DCMAKE_EXE_LINKER_FLAGS="-static-libgcc -static-libstdc++"
cmake --build build --config ${{ env.BUILD_TYPE }}

- name: Run tests
run: |
cd build
parallel --halt now,fail=1 qemu-riscv64-static -L /usr/riscv64-linux-gnu/ ::: $(find ./static -type f -executable -printf '%p ')

- name: Upload test logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-logs
path: |
${{github.workspace}}/build/Testing
${{github.workspace}}/build/CMakeCache.txt
${{github.workspace}}/build/CMakeFiles/CMakeOutput.log
${{github.workspace}}/build/CMakeFiles/CMakeError.log
Loading