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
9 changes: 9 additions & 0 deletions .github/workflows/compatibility_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ jobs:
matrix:
go-version: [1.18.x, 1.19.x, 1.20.x, 1.21.x, 1.22.x, 1.23.x, 1.24.x, 1.25.x]
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest]
exclude:
# Go <= 1.22 lack the cmd/link LC_UUID fix (golang/go#68678): under the
# stricter dyld on the macos-latest image their test binaries abort with
# "missing LC_UUID load command". These versions stay covered on Linux.
- { go-version: 1.18.x, os: macos-latest }
- { go-version: 1.19.x, os: macos-latest }
- { go-version: 1.20.x, os: macos-latest }
- { go-version: 1.21.x, os: macos-latest }
- { go-version: 1.22.x, os: macos-latest }
runs-on: ${{ matrix.os }}
steps:
- name: Clear repository
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/test-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ jobs:
matrix:
go-version: [1.20.x, 1.22.x, 1.25.x]
runner_arch: [ubuntu-24.04-arm, macos-latest]
exclude:
# Go <= 1.22 lack the cmd/link LC_UUID fix (golang/go#68678): under the
# stricter dyld on the macos-latest image their test binaries abort with
# "missing LC_UUID load command". These versions stay covered on Linux arm.
- { go-version: 1.20.x, runner_arch: macos-latest }
- { go-version: 1.22.x, runner_arch: macos-latest }

runs-on: ${{ matrix.runner_arch }}

Expand Down
88 changes: 88 additions & 0 deletions .github/workflows/test-riscv64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@

name: Unit Test RISC-V

on: pull_request

jobs:
build:
permissions:
contents: read
id-token: write

strategy:
matrix:
include:
# sonic falls back to the compat (encoding/json) path on riscv64.
# Keep go1.22 covered without -race; linux/riscv64 race support
# starts with go1.26.
- go-version: 1.22.x
runner_arch: ubuntu-24.04-riscv
test_flags: ""
cover_flags: ""
coverage_flag: go1-22
- go-version: 1.26.x
runner_arch: ubuntu-24.04-riscv
test_flags: "-race"
cover_flags: "-covermode=atomic"
coverage_flag: go1-26

runs-on: ${{ matrix.runner_arch }}

steps:
- name: Clear repository
run: rm -fr $GITHUB_WORKSPACE && mkdir $GITHUB_WORKSPACE

- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go-version }}
cache: true

- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
${{ github.workspace }}/go.sum
key: ${{ runner.os }}-riscv-go-${{ hashFiles('**/go.sum') }}

- name: Unit Test
run: |
GOMAXPROCS=4 go test ${{ matrix.test_flags }} ${{ matrix.cover_flags }} -coverprofile=coverage.txt \
./ \
./ast \
./decoder \
./encoder \
./option \
./unquote \
./utf8 \
./internal/caching \
./internal/compat \
./internal/cpu \
./internal/decoder/consts \
./internal/decoder/errors \
./internal/encoder/alg \
./internal/encoder/prim \
./internal/encoder/vars \
./internal/envs \
./internal/optcaching \
./internal/resolver \
./internal/rt \
./internal/utils \
./internal/native/types

- name: Issue Test
run: GOMAXPROCS=4 go test ${{ matrix.test_flags }} ./issue_test

- name: Generic Test
run: GOMAXPROCS=4 go test ${{ matrix.test_flags }} ./generic_test

- name: Codecov
uses: codecov/codecov-action@v5
with:
use_oidc: true
files: ./coverage.txt
flags: riscv64,${{ matrix.runner_arch }},${{ matrix.coverage_flag }}
fail_ci_if_error: false
Loading