@@ -51,48 +51,48 @@ jobs:
5151 echo "docs_only=${{ fromJSON(steps.changes.outputs.all_count) == fromJSON(steps.changes.outputs.docs_count) && fromJSON(steps.changes.outputs.docs_count) > 0 }}" >> $GITHUB_OUTPUT
5252
5353 check-typos :
54- name : Check typos
54+ name : Check typos and licenses
5555 runs-on : ubuntu-22.04
5656 env :
5757 FORCE_COLOR : 1
5858 steps :
5959 - uses : actions/checkout@v4
6060 - name : Check typos
61- uses : crate-ci/typos@v1.35 .1
61+ uses : crate-ci/typos@v1.43 .1
6262 with :
6363 config : .github/config/typos.toml
64+ - uses : apache/skywalking-eyes/header@v0.7.0
65+ with :
66+ config : .github/config/licenserc.yml
6467
6568 check-and-lint :
6669 name : Lint and check code
67- needs : [precondition]
70+ needs : [precondition, check-typos ]
6871 if : ${{ needs.precondition.outputs.docs_only != 'true' }}
69- runs-on : ubuntu-22 .04
72+ runs-on : ubuntu-24 .04
7073 steps :
7174 - uses : actions/checkout@v4
72- - uses : apache/skywalking-eyes/header@v0.7.0
73- with :
74- config : .github/config/licenserc.yml
7575 - uses : actions/setup-go@v5
7676 with :
7777 go-version-file : ' tests/gocase/go.mod'
7878 cache : false
7979 - name : Prepare Dependencies
8080 run : |
8181 sudo apt update
82- sudo apt install -y clang-format-14 clang-tidy-14
82+ sudo apt install -y clang-format-18 clang-tidy-18
8383 - name : Check with clang-format
8484 id : check-format
85- run : ./x.py check format --clang-format-path clang-format-14
85+ run : ./x.py check format --clang-format-path clang-format-18
8686 - name : Check with clang-tidy
8787 run : |
8888 ./x.py build --skip-build
89- ./x.py check tidy -j $(nproc) --clang-tidy-path clang-tidy-14 --run-clang-tidy-path run-clang-tidy-14
89+ ./x.py check tidy -j $(nproc) --clang-tidy-path clang-tidy-18 --run-clang-tidy-path run-clang-tidy-18
9090 - name : Lint with golangci-lint
9191 run : ./x.py check golangci-lint
9292 - name : Prepare format patch
9393 if : always() && steps.check-format.outcome != 'success'
9494 run : |
95- ./x.py format --clang-format-path clang-format-14
95+ ./x.py format --clang-format-path clang-format-18
9696 git diff -p > clang-format.patch
9797 cat clang-format.patch
9898 - name : Upload format patch
@@ -103,7 +103,7 @@ jobs:
103103
104104 build-and-test :
105105 name : Build and test
106- needs : [precondition, check-and-lint, check- typos]
106+ needs : [precondition, check-typos]
107107 if : ${{ needs.precondition.outputs.docs_only != 'true' }}
108108 strategy :
109109 fail-fast : false
@@ -150,13 +150,12 @@ jobs:
150150 - name : Ubuntu Clang
151151 os : ubuntu-22.04
152152 compiler : clang
153- # FIXME: https://github.com/apache/kvrocks/issues/2411
154- # - name: Ubuntu 24 GCC
155- # os: ubuntu-24.04
156- # compiler: gcc
157- # - name: Ubuntu 24 Clang
158- # os: ubuntu-24.04
159- # compiler: clang
153+ - name : Ubuntu 24 GCC
154+ os : ubuntu-24.04
155+ compiler : gcc
156+ - name : Ubuntu 24 Clang
157+ os : ubuntu-24.04
158+ compiler : clang
160159 - name : Ubuntu GCC ASan
161160 os : ubuntu-22.04
162161 without_jemalloc : -DDISABLE_JEMALLOC=ON
@@ -223,12 +222,33 @@ jobs:
223222 os : ubuntu-24.04-arm
224223 compiler : clang
225224 arm_linux : true
225+ - name : Ubuntu RISC-V GCC without luaJIT (QEMU)
226+ os : ubuntu-24.04
227+ riscv_toolchain : true
228+ toolchain_file : cmake/riscv64.cmake
229+ riscv_toolchain_url : " https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/2025.07.03/riscv64-glibc-ubuntu-24.04-gcc-nightly-2025.07.03-nightly.tar.xz"
230+ cmake_crosscompiling : -DCMAKE_CROSSCOMPILING=TRUE
231+ cmake_system_name : -DCMAKE_SYSTEM_NAME=Linux
232+ cmake_system_processor : -DCMAKE_SYSTEM_PROCESSOR=riscv64
233+ without_luajit : -DENABLE_LUAJIT=OFF
226234
227235 runs-on : ${{ matrix.os }}
228236 env :
229237 SONARCLOUD_OUTPUT_DIR : sonarcloud-data
230238 FORCE_JAVASCRIPT_ACTIONS_TO_NODE20 : true
239+ RISCV_PATH : " /opt/riscv"
231240 steps :
241+ - name : Maximize build space
242+ if : ${{ startsWith(matrix.os, 'ubuntu') }}
243+ run : |
244+ # refer to https://github.com/easimon/maximize-build-space,
245+ # we take some ideas from this action but don't use it directly.
246+ sudo df -h
247+ sudo rm -rf /usr/share/dotnet
248+ sudo rm -rf /usr/local/lib/android
249+ sudo rm -rf /opt/ghc
250+ sudo df -h
251+
232252 - name : Setup macOS
233253 if : ${{ startsWith(matrix.os, 'macos') }}
234254 run : |
@@ -253,6 +273,21 @@ jobs:
253273 if : ${{ matrix.arm_linux }}
254274 run : |
255275 sudo apt install -y git build-essential cmake libtool python3 python3-pip libssl-dev
276+ - name : Setup RISC-V Toolchain
277+ if : ${{ matrix.riscv_toolchain }}
278+ run : |
279+ sudo apt install -y wget build-essential cmake git python3 \
280+ libgflags-dev libsnappy-dev zlib1g-dev liblz4-dev libzstd-dev \
281+ qemu-user qemu-user-static
282+ sudo mkdir -p $RISCV_PATH
283+ wget "${{ matrix.riscv_toolchain_url }}" -O riscv-toolchain.tar.xz
284+ sudo tar -xvf riscv-toolchain.tar.xz -C $RISCV_PATH --strip-components=1
285+ rm riscv-toolchain.tar.xz
286+ sudo sed -i "s|libdir='/mnt/riscv/riscv64-unknown-linux-gnu/lib'|libdir='$RISCV_PATH/riscv64-unknown-linux-gnu/lib'|g" \
287+ $RISCV_PATH/riscv64-unknown-linux-gnu/lib/libatomic.la
288+ echo "PATH=$RISCV_PATH/bin:$PATH" >> $GITHUB_ENV
289+ echo "LD_LIBRARY_PATH=/opt/riscv/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
290+ echo "QEMU_LD_PREFIX=$RISCV_PATH/sysroot" >> $GITHUB_ENV
256291
257292 - name : Cache redis
258293 id : cache-redis
@@ -293,12 +328,12 @@ jobs:
293328 run : pip install gcovr==5.0 # 5.1 is not supported
294329 if : ${{ matrix.sonarcloud }}
295330
296- - name : Install sonar-scanner and build-wrapper
297- uses : SonarSource/sonarcloud-github-c-cpp@v3
331+ - name : Install Build Wrapper
332+ uses : SonarSource/sonarqube-scan-action/install-build-wrapper@v6.0.0
298333 if : ${{ matrix.sonarcloud }}
299334
300335 - name : Build Kvrocks
301- if : ${{ !matrix.sonarcloud }}
336+ if : ${{ !matrix.sonarcloud && !matrix.riscv_toolchain }}
302337 run : |
303338 ./x.py build -j$NPROC --unittest --compiler ${{ matrix.compiler }} ${{ matrix.without_jemalloc }} \
304339 ${{ matrix.without_luajit }} ${{ matrix.with_ninja }} ${{ matrix.with_sanitizer }} ${{ matrix.with_openssl }} \
@@ -311,6 +346,11 @@ jobs:
311346 cp -r build _build
312347 build-wrapper-linux-x86-64 --out-dir ${{ env.SONARCLOUD_OUTPUT_DIR }} ./x.py build -j$NPROC --unittest --compiler ${{ matrix.compiler }} ${{ matrix.sonarcloud }}
313348
349+ - name : Build Kvrocks (RISC-V)
350+ if : ${{ matrix.riscv_toolchain }}
351+ run : |
352+ ./x.py build -j$NPROC --unittest --toolchain ${{ matrix.toolchain_file }}
353+
314354 - name : Setup Coredump
315355 if : ${{ startsWith(matrix.os, 'ubuntu') }}
316356 run : |
@@ -416,7 +456,7 @@ jobs:
416456
417457 check-docker :
418458 name : Check Docker image
419- needs : [precondition, check-and-lint, check- typos]
459+ needs : [precondition, check-typos]
420460 if : ${{ needs.precondition.outputs.docs_only != 'true' }}
421461 runs-on : ${{ matrix.os }}
422462 strategy :
@@ -450,7 +490,7 @@ jobs:
450490
451491 build-and-test-in-container :
452492 name : Build and test in container
453- needs : [precondition, check-and-lint, check- typos]
493+ needs : [precondition, check-typos]
454494 if : ${{ needs.precondition.outputs.docs_only != 'true' }}
455495 strategy :
456496 fail-fast : false
@@ -472,14 +512,23 @@ jobs:
472512 image : debian:12
473513 compiler : gcc
474514 - name : Alpine 3
475- image : alpine:3
515+ image : alpine:3.22
476516 compiler : gcc
477517 disable_jemalloc : -DDISABLE_JEMALLOC=ON
478518
479519 runs-on : ubuntu-22.04
480520 container :
481521 image : ${{ matrix.image }}
522+ volumes :
523+ - /usr/local/lib/android:/usr-local-lib-android
524+ - /usr/share/dotnet:/usr-share-dotnet
482525 steps :
526+ - name : Maximize build space
527+ run : |
528+ df -h
529+ rm -rf /usr-local-lib-android/*
530+ rm -rf /usr-share-dotnet/*
531+ df -h
483532 - name : Setup ArchLinux
484533 if : ${{ startsWith(matrix.image, 'archlinux') }}
485534 run : |
@@ -493,7 +542,7 @@ jobs:
493542 - name : Setup openSUSE
494543 if : ${{ startsWith(matrix.image, 'opensuse') }}
495544 run : |
496- zypper install -y gcc11 gcc11-c++ make wget git autoconf automake python3 python3-pip curl tar gzip cmake go
545+ zypper install -y gcc11 gcc11-c++ make wget git autoconf automake python3 python3-pip curl tar gzip cmake go which
497546 update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-11 100
498547 update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-11 100
499548 update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100
@@ -618,6 +667,7 @@ jobs:
618667 runs-on : ubuntu-latest
619668 needs :
620669 - precondition
670+ - check-and-lint
621671 - build-and-test
622672 - build-and-test-in-container
623673 - check-docker
0 commit comments