Skip to content

ci: add RISC-V (riscv64) unit test workflow#959

Open
liuq19 wants to merge 4 commits into
bytedance:mainfrom
liuq19:ci/riscv64-runners
Open

ci: add RISC-V (riscv64) unit test workflow#959
liuq19 wants to merge 4 commits into
bytedance:mainfrom
liuq19:ci/riscv64-runners

Conversation

@liuq19

@liuq19 liuq19 commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

What

Adds a GitHub Actions workflow (.github/workflows/test-riscv64.yml) that runs sonic's unit / issue / generic tests on real riscv64 hardware using the RISE project ephemeral runners (runs-on: ubuntu-24.04-riscv).

Details

  • On riscv64 sonic falls back to its compat path (encoding/json), so the JIT/VM-specific suites don't apply. The workflow runs an explicit riscv64-safe package set and avoids native/JIT-only internal packages.
  • Covers go1.22 without -race, and go1.26 with -race because the race detector supports linux/riscv64 starting with go1.26.
  • Uploads coverage to Codecov with riscv64, runner, and Go-version flags.

Note for maintainers

The RISE runners require their GitHub App to be installed on the bytedance org (or this repo) before ubuntu-24.04-riscv jobs can be scheduled - see https://riscv-runners.riseproject.dev/ -> "Install the GitHub App". Until then this job will stay queued waiting for a runner.

Copilot AI review requested due to automatic review settings June 26, 2026 06:05
Run sonic's compat-mode unit/issue/generic tests on real riscv64
hardware via the RISE project ephemeral GitHub Actions runners
(ubuntu-24.04-riscv, https://riscv-runners.riseproject.dev/).

Pinned to go1.25 since the race detector requires go1.23+ on
linux/riscv64; arch-specific JIT packages are excluded as sonic
falls back to encoding/json on riscv64.
@liuq19 liuq19 force-pushed the ci/riscv64-runners branch from 128c311 to 1acb09d Compare June 26, 2026 06:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new GitHub Actions workflow to run Sonic’s unit/issue/generic test suites on real riscv64 hardware via RISE ephemeral runners (runs-on: ubuntu-24.04-riscv), including coverage upload to Codecov.

Changes:

  • Introduces .github/workflows/test-riscv64.yml to run go test suites on RISC-V runners, excluding arch-specific packages.
  • Configures Go setup + module caching and uploads coverage to Codecov with riscv64 flags.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/test-riscv64.yml Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 128c3118ef

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/test-riscv64.yml Outdated

- name: Unit Test
run: |
GOMAXPROCS=4 go test -race -covermode=atomic -coverprofile=coverage.txt $(go list ./... | grep -v -E 'loader|jit|avx|x86|sse')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Drop -race from RISC-V test commands

On the ubuntu-24.04-riscv runner these commands execute as linux/riscv64, but go help build for Go 1.25 lists -race support only for linux/amd64, freebsd/amd64, darwin/amd64, darwin/arm64, windows/amd64, linux/ppc64le, and linux/arm64; GOOS=linux GOARCH=riscv64 go test -race fails with -race is not supported on linux/riscv64. Because every test step in this workflow uses -race, the new PR workflow will fail before running any tests.

Useful? React with 👍 / 👎.

Comment thread .github/workflows/test-riscv64.yml Outdated

- name: Unit Test
run: |
GOMAXPROCS=4 go test -race -covermode=atomic -coverprofile=coverage.txt $(go list ./... | grep -v -E 'loader|jit|avx|x86|sse')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Exclude native-only internal packages on RISC-V

Even after removing -race, this package list still includes non-compat internal packages such as github.com/bytedance/sonic/internal/decoder/api; on GOOS=linux GOARCH=riscv64, go list -deps ./internal/decoder/api reports that its internal/native dependency has all files excluded by build constraints, since the native dispatch files are only _amd64/_arm64. The grep only removes paths containing loader|jit|avx|x86|sse, so the new RISC-V unit job will still try to build packages that cannot compile on riscv64.

Useful? React with 👍 / 👎.

@codecov-commenter

codecov-commenter commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.24%. Comparing base (59be92f) to head (f001568).
⚠️ Report is 83 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #959      +/-   ##
==========================================
- Coverage   51.86%   51.24%   -0.63%     
==========================================
  Files         127      170      +43     
  Lines       10893    14145    +3252     
==========================================
+ Hits         5650     7249    +1599     
- Misses       4920     6505    +1585     
- Partials      323      391      +68     
Flag Coverage Δ
arm 42.87% <ø> (?)
macos-latest 39.03% <ø> (?)
ubuntu-24.04-arm 42.85% <ø> (?)
ubuntu-latest 49.72% <ø> (?)
x86 49.72% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

liuq19 added 2 commits June 26, 2026 14:24
Old Go toolchains lack the cmd/link change that emits LC_UUID
(golang/go#68678, fixed in go1.23). On the current macos-latest image
the stricter dyld rejects their test binaries with 'missing LC_UUID
load command -> signal: abort trap', failing every package before any
test runs and cancelling the rest of the matrix via fail-fast.

Exclude the Go<=1.22 x macos-latest combinations; those versions stay
covered on the Linux runners, and macOS keeps testing go1.23+.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants