This is an automated email from the ASF dual-hosted git repository.

twice pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/kvrocks.git


The following commit(s) were added to refs/heads/unstable by this push:
     new 943af5c8 Add container environment for building and testing in CI 
(#1569)
943af5c8 is described below

commit 943af5c8b3066d6bb07b3e58520aeb352100aa33
Author: Twice <[email protected]>
AuthorDate: Mon Jul 10 13:00:50 2023 +0800

    Add container environment for building and testing in CI (#1569)
    
    In this PR, we add a container environment (currently CentOS 7) for 
building and testing in CI.
---
 .github/workflows/kvrocks.yaml | 65 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)

diff --git a/.github/workflows/kvrocks.yaml b/.github/workflows/kvrocks.yaml
index 505e39ea..e191d614 100644
--- a/.github/workflows/kvrocks.yaml
+++ b/.github/workflows/kvrocks.yaml
@@ -291,6 +291,70 @@ jobs:
           context: .
           build-args: MORE_BUILD_ARGS=-j${{ env.NPROC }}
 
+  build-and-test-on-container:
+    name: Build and test on container
+    needs: [precondition, check-and-lint]
+    if: ${{ needs.precondition.outputs.docs_only != 'true' }}
+    strategy:
+      fail-fast: false
+      matrix:
+        include:
+          - name: CentOS 7
+            image: centos:7
+            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 autoconf automake wget git
+          echo "NPROC=$(nproc)" >> $GITHUB_ENV
+
+      - name: Cache redis
+        id: cache-redis
+        uses: actions/cache@v3
+        with:
+          path: |
+            ~/local/bin/redis-cli
+          key: ${{ matrix.image }}-redis-cli
+      - name: Install redis
+        if: steps.cache-redis.outputs.cache-hit != 'true'
+        run: |
+          curl -O https://download.redis.io/releases/redis-6.2.7.tar.gz
+          tar -xzvf redis-6.2.7.tar.gz
+          mkdir -p $HOME/local/bin
+          pushd redis-6.2.7 && USE_JEMALLOC=no make -j$NPROC redis-cli && mv 
src/redis-cli $HOME/local/bin/ && popd
+
+      - name: Install cmake
+        run: |
+          wget 
https://github.com/Kitware/CMake/releases/download/v3.26.4/cmake-3.26.4-linux-x86_64.sh
+          bash cmake-3.26.4-linux-x86_64.sh --skip-license --prefix=/usr
+
+      - uses: actions/checkout@v3
+      - uses: actions/setup-go@v3
+        with:
+          go-version-file: 'tests/gocase/go.mod'
+
+      - name: Build Kvrocks
+        if: ${{ startsWith(matrix.image, 'centos') }}
+        run: |
+          source /opt/rh/devtoolset-11/enable
+          ./x.py build -j$NPROC --unittest --compiler ${{ matrix.compiler }}
+
+      - name: Run Unit Test
+        run: |
+          ./x.py test cpp
+
+      - name: Run Go Integration Cases
+        run: |
+          export PATH=$PATH:$HOME/local/bin/
+          GOCASE_RUN_ARGS=""
+          ./x.py test go build $GOCASE_RUN_ARGS
+
   required:
     if: always()
     name: Required
@@ -298,6 +362,7 @@ jobs:
     needs:
       - precondition
       - build-and-test
+      - build-and-test-on-container
       - check-docker
     steps:
       - name: Merge requirement checking

Reply via email to