-
-
Notifications
You must be signed in to change notification settings - Fork 68
Added CI script for running Test Suite on RISC-V #480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
singul4ri7y
wants to merge
4
commits into
stillwater-sc:main
Choose a base branch
from
singul4ri7y:riscv-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| 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@v3 | ||
| with: | ||
| path: riscv-tests | ||
| key: ${{ steps.cache-key.outputs.key }} | ||
|
|
||
| - name: Setup runtime dependencies | ||
| run: | | ||
| sudo apt update | ||
| sudo apt install -y qemu-user-static libc6-dev-riscv64-cross libstdc++6-riscv64-cross libgcc-s1-riscv64-cross parallel | ||
|
|
||
| - name: Setup RISC-V build toolchain | ||
| if: steps.cache-build.outputs.cache-hit != 'true' | ||
| run: | | ||
| sudo apt install -y cmake ninja-build gcc-riscv64-linux-gnu g++-riscv64-linux-gnu | ||
|
|
||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - 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=Release \ | ||
| -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 Release | ||
|
|
||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - name: Run tests (parallel) | ||
| run: | | ||
| cd build | ||
| parallel --halt now,fail=1 qemu-riscv64-static -L /usr/riscv64-linux-gnu/ ::: $(find ./static -type f -executable -printf '%p ') | ||
|
|
||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - 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 | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix cache action version and path (v3 is broken; caching wrong directory).
Apply:
📝 Committable suggestion
🧰 Tools
🪛 actionlint (1.7.7)
28-28: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🤖 Prompt for AI Agents