Skip to content

Commit

Permalink
Merge branch 'unstable' into minor/trying-to-fix-sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksraiden authored Sep 9, 2024
2 parents feb0675 + a29df09 commit c94d3c4
Show file tree
Hide file tree
Showing 242 changed files with 15,468 additions and 5,082 deletions.
11 changes: 11 additions & 0 deletions .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ github:
strict: true
contexts:
- Required
'1.3': {}
'2.0': {}
'2.1': {}
'2.2': {}
'2.3': {}
'2.4': {}
'2.5': {}
'2.6': {}
'2.7': {}
'2.8': {}
'2.9': {}

notifications:
commits: commits@kvrocks.apache.org
Expand Down
135 changes: 78 additions & 57 deletions .github/workflows/kvrocks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ jobs:
FORCE_COLOR: 1
steps:
- uses: actions/checkout@v4
- name: Install typos
run: curl -LsSf https://github.com/crate-ci/typos/releases/download/v1.18.2/typos-v1.18.2-x86_64-unknown-linux-musl.tar.gz | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
- name: Run typos check
run: typos --config .github/config/typos.toml
- name: Check typos
uses: crate-ci/typos@v1.22.9
with:
config: .github/config/typos.toml

check-and-lint:
name: Lint and check code
Expand Down Expand Up @@ -111,46 +111,47 @@ jobs:
matrix:
include:
- name: Darwin Clang
os: macos-11
os: macos-13
compiler: auto
- name: Darwin Clang arm64
os: macos-14
compiler: auto
- name: Darwin Clang without Jemalloc
os: macos-11
os: macos-13
compiler: auto
without_jemalloc: -DDISABLE_JEMALLOC=ON
- name: Darwin Clang with OpenSSL
os: macos-11
os: macos-13
compiler: auto
with_openssl: -DENABLE_OPENSSL=ON
- name: Darwin Clang without luaJIT
os: macos-11
os: macos-13
compiler: auto
without_luajit: -DENABLE_LUAJIT=OFF
- name: Ubuntu GCC
os: ubuntu-20.04
os: ubuntu-22.04
compiler: gcc
- name: SonarCloud with Coverage
os: ubuntu-22.04
compiler: gcc
sonarcloud: -DCMAKE_CXX_FLAGS=--coverage
- name: Ubuntu Clang
os: ubuntu-20.04
compiler: clang
- name: Ubuntu 22 GCC
os: ubuntu-22.04
compiler: gcc
- name: Ubuntu 22 Clang
os: ubuntu-22.04
compiler: clang
# FIXME: https://github.com/apache/kvrocks/issues/2411
# - name: Ubuntu 24 GCC
# os: ubuntu-24.04
# compiler: gcc
# - name: Ubuntu 24 Clang
# os: ubuntu-24.04
# compiler: clang
- name: Ubuntu GCC ASan
os: ubuntu-20.04
os: ubuntu-22.04
without_jemalloc: -DDISABLE_JEMALLOC=ON
with_sanitizer: -DENABLE_ASAN=ON
compiler: gcc
- name: Ubuntu Clang ASan
os: ubuntu-20.04
os: ubuntu-22.04
with_sanitizer: -DENABLE_ASAN=ON
without_jemalloc: -DDISABLE_JEMALLOC=ON
compiler: clang
Expand All @@ -161,48 +162,44 @@ jobs:
compiler: gcc
ignore_when_tsan: -tags="ignore_when_tsan"
- name: Ubuntu Clang TSan
os: ubuntu-20.04
os: ubuntu-22.04
with_sanitizer: -DENABLE_TSAN=ON
without_jemalloc: -DDISABLE_JEMALLOC=ON
compiler: clang
ignore_when_tsan: -tags="ignore_when_tsan"
- name: Ubuntu Clang UBSAN
os: ubuntu-20.04
os: ubuntu-22.04
with_sanitizer: -DENABLE_UBSAN=ON
without_jemalloc: -DDISABLE_JEMALLOC=ON
compiler: clang
- name: Ubuntu GCC Ninja
os: ubuntu-20.04
os: ubuntu-22.04
with_ninja: --ninja
compiler: gcc
- name: Ubuntu GCC with OpenSSL
os: ubuntu-20.04
os: ubuntu-22.04
compiler: gcc
with_openssl: -DENABLE_OPENSSL=ON
- name: Ubuntu Clang with OpenSSL
os: ubuntu-22.04
compiler: clang
with_openssl: -DENABLE_OPENSSL=ON
- name: Ubuntu GCC without luaJIT
os: ubuntu-20.04
os: ubuntu-22.04
without_luajit: -DENABLE_LUAJIT=OFF
compiler: gcc
- name: Ubuntu Clang without luaJIT
os: ubuntu-20.04
os: ubuntu-22.04
without_luajit: -DENABLE_LUAJIT=OFF
compiler: clang
- name: Ubuntu GCC with old encoding
os: ubuntu-20.04
os: ubuntu-22.04
compiler: gcc
new_encoding: -DENABLE_NEW_ENCODING=FALSE
- name: Ubuntu Clang with old encoding
os: ubuntu-22.04
compiler: clang
new_encoding: -DENABLE_NEW_ENCODING=FALSE
- name: Ubuntu GCC with speedb enabled
os: ubuntu-20.04
compiler: gcc
with_speedb: -DENABLE_SPEEDB=ON

runs-on: ${{ matrix.os }}
env:
Expand All @@ -211,7 +208,7 @@ jobs:
- name: Setup macOS
if: ${{ startsWith(matrix.os, 'macos') }}
run: |
brew install cmake gcc autoconf automake libtool openssl
brew install cmake gcc autoconf automake libtool openssl coreutils
echo "NPROC=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV
echo "CMAKE_EXTRA_DEFS=-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl" >> $GITHUB_ENV
- name: Setup Linux
Expand Down Expand Up @@ -268,7 +265,7 @@ jobs:
run: |
./x.py build -j$NPROC --unittest --compiler ${{ matrix.compiler }} ${{ matrix.without_jemalloc }} \
${{ matrix.without_luajit }} ${{ matrix.with_ninja }} ${{ matrix.with_sanitizer }} ${{ matrix.with_openssl }} \
${{ matrix.new_encoding }} ${{ matrix.with_speedb }} ${{ env.CMAKE_EXTRA_DEFS }}
${{ matrix.new_encoding }} ${{ env.CMAKE_EXTRA_DEFS }}
- name: Build Kvrocks (SonarCloud)
if: ${{ matrix.sonarcloud }}
Expand Down Expand Up @@ -329,7 +326,6 @@ jobs:
sleep 10s
python3 utils/kvrocks2redis/tests/populate-kvrocks.py --password="" --flushdb=true
sleep 10s
ps aux
python3 utils/kvrocks2redis/tests/check_consistency.py --src_password=""
- name: Find reports and crashes
Expand Down Expand Up @@ -390,7 +386,7 @@ jobs:
- uses: actions/checkout@v4
- name: Get core numbers
run: echo "NPROC=$(nproc)" >> $GITHUB_ENV
- uses: docker/build-push-action@v5
- uses: docker/build-push-action@v6
with:
context: .
build-args: MORE_BUILD_ARGS=-j${{ env.NPROC }}
Expand Down Expand Up @@ -420,31 +416,26 @@ jobs:
fail-fast: false
matrix:
include:
- name: CentOS 7
image: centos:7
compiler: gcc
- name: openSUSE Leap 15
image: opensuse/leap:15
compiler: gcc
- name: ArchLinux
image: archlinux:base
compiler: gcc
- name: Rocky Linux 8
image: rockylinux:8
compiler: gcc
- name: Rocky Linux 9
image: rockylinux:9
compiler: gcc
- name: Debian 12
image: debian:12
compiler: gcc

runs-on: ubuntu-22.04
container:
image: ${{ matrix.image }}
steps:
- name: Setup CentOS
if: ${{ startsWith(matrix.image, 'centos') }}
run: |
yum install -y centos-release-scl-rh
yum install -y devtoolset-11 python3 python3-pip autoconf automake wget git gcc gcc-c++
echo "NPROC=$(nproc)" >> $GITHUB_ENV
mv /usr/bin/gcc /usr/bin/gcc-4.8.5
ln -s /opt/rh/devtoolset-11/root/bin/gcc /usr/bin/gcc
mv /usr/bin/g++ /usr/bin/g++-4.8.5
ln -s /opt/rh/devtoolset-11/root/bin/g++ /usr/bin/g++
- name: Setup ArchLinux
if: ${{ startsWith(matrix.image, 'archlinux') }}
run: |
Expand All @@ -462,6 +453,37 @@ jobs:
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100
echo "NPROC=$(nproc)" >> $GITHUB_ENV
- name: Setup Rocky Linux 8
if: ${{ startsWith(matrix.image, 'rockylinux:8') }}
run: |
dnf install -y epel-release
dnf config-manager --set-enabled powertools
dnf install -y git gcc-toolset-12 autoconf automake libtool libstdc++-static python3 python3-pip openssl-devel which cmake
source /opt/rh/gcc-toolset-12/enable
update-alternatives --install /usr/bin/g++ g++ /opt/rh/gcc-toolset-12/root/usr/bin/g++ 100
update-alternatives --install /usr/bin/cc cc /opt/rh/gcc-toolset-12/root/usr/bin/gcc 100
update-alternatives --install /usr/bin/c++ c++ /opt/rh/gcc-toolset-12/root/usr/bin/g++ 100
echo "NPROC=$(nproc)" >> $GITHUB_ENV
- name: Setup Rocky Linux 9
if: ${{ startsWith(matrix.image, 'rockylinux:9') }}
run: |
dnf install -y epel-release
dnf config-manager --set-enabled crb
dnf install -y git gcc-toolset-12 autoconf automake libtool libstdc++-static python3 python3-pip openssl-devel which cmake
source /opt/rh/gcc-toolset-12/enable
update-alternatives --install /usr/bin/g++ g++ /opt/rh/gcc-toolset-12/root/usr/bin/g++ 100
update-alternatives --install /usr/bin/cc cc /opt/rh/gcc-toolset-12/root/usr/bin/gcc 100
update-alternatives --install /usr/bin/c++ c++ /opt/rh/gcc-toolset-12/root/usr/bin/g++ 100
echo "NPROC=$(nproc)" >> $GITHUB_ENV
- name: Setup Debian 12
if: ${{ startsWith(matrix.image, 'debian') }}
run: |
apt update
apt install -y bash build-essential cmake curl git libssl-dev libtool python3 python3-pip wget
echo "NPROC=$(nproc)" >> $GITHUB_ENV
- name: Cache redis
id: cache-redis
uses: actions/cache@v3
Expand All @@ -480,22 +502,16 @@ jobs:

- name: Install redis
if: ${{ steps.cache-redis.outputs.cache-hit != 'true' || steps.cache-redis-server.outputs.cache-hit != 'true' }}
shell: bash
run: |
curl -O https://download.redis.io/releases/redis-6.2.14.tar.gz
tar -xzvf redis-6.2.14.tar.gz
mkdir -p $HOME/local/bin
pushd redis-6.2.14 && USE_JEMALLOC=no make -j$NPROC redis-cli && mv src/redis-cli $HOME/local/bin/ && popd
pushd redis-6.2.14 && USE_JEMALLOC=no make -j$NPROC redis-server && mv src/redis-server $HOME/local/bin/ && popd
- name: Install cmake
if: ${{ startsWith(matrix.image, 'centos') }}
run: |
VERSION=3.26.4
wget https://github.com/Kitware/CMake/releases/download/v$VERSION/cmake-$VERSION-linux-x86_64.sh
bash cmake-$VERSION-linux-x86_64.sh --skip-license --prefix=/usr
- uses: actions/checkout@v3 #v4 use Node 20 and not working at CentOS 7
- uses: actions/setup-go@v4 #v5 use Node 20 too
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
if: ${{ !startsWith(matrix.image, 'opensuse') }}
with:
go-version-file: 'tests/gocase/go.mod'
Expand All @@ -515,11 +531,16 @@ jobs:
GOCASE_RUN_ARGS=""
./x.py test go build $GOCASE_RUN_ARGS
- name: Install redis-py
if: ${{ !startsWith(matrix.image, 'archlinux') }} # already installed
- name: Install redis-py for openSUSE and Rocky
if: ${{ !startsWith(matrix.image, 'archlinux') && !startsWith(matrix.image, 'debian') }}
run: pip3 install redis==4.3.6

- name: Install redis-py for Debian
if: ${{ startsWith(matrix.image, 'debian') }}
run: apt install -y python3-redis

- name: Run kvrocks2redis Test
shell: bash
run: |
$HOME/local/bin/redis-server --daemonize yes
mkdir -p kvrocks2redis-ci-data
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
type=sha,prefix=nightly-{{date 'YYYYMMDD'}}-,format=short
type=raw,value=nightly
- uses: docker/build-push-action@v5
- uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64, linux/arm64
Expand Down
Loading

0 comments on commit c94d3c4

Please sign in to comment.