Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add centos CI in github action #2942

Merged
111 changes: 86 additions & 25 deletions .github/workflows/pika.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,59 +84,49 @@ jobs:
chmod +x integrate_test.sh
sh integrate_test.sh

build_on_rocky:

build_on_centos:
runs-on: ubuntu-latest
container:
image: rockylinux:9
image: cheniujh/pika-ci-centos7:v1
cheniujh marked this conversation as resolved.
Show resolved Hide resolved

steps:
- name: Install deps
- name: use SCL
run: |
dnf update -y
dnf install -y bash cmake wget git autoconf gcc perl-Digest-SHA tcl which tar g++ tar epel-release gcc-c++ libstdc++-devel gcc-toolset-13

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.19
yum install centos-release-scl
yum install devtoolset-9
scl enable devtoolset-9 bash
cheniujh marked this conversation as resolved.
Show resolved Hide resolved

- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Configure CMake
run: |
source /opt/rh/gcc-toolset-13/enable
cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DUSE_PIKA_TOOLS=ON -DCMAKE_CXX_FLAGS_DEBUG=-fsanitize=address .

source /opt/rh/devtoolset-10/enable
cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DUSE_PIKA_TOOLS=ON -DCMAKE_CXX_FLAGS_DEBUG=-fsanitize=address
cheniujh marked this conversation as resolved.
Show resolved Hide resolved
- uses: actions/cache@v3
with:
path: ${{ github.workspace }}/deps
key: ${{ runner.os }}-rocky-deps-${{ hashFiles('**/CMakeLists.txt') }}
key: ${{ runner.os }}-centos-deps-${{ hashFiles('**/CMakeLists.txt') }}

- uses: actions/cache@v3
with:
path: ${{ github.workspace }}/buildtrees
key: ${{ runner.os }}-rocky-buildtrees-${{ hashFiles('**/CMakeLists.txt') }}
key: ${{ runner.os }}-centos-buildtrees-${{ hashFiles('**/CMakeLists.txt') }}
cheniujh marked this conversation as resolved.
Show resolved Hide resolved

- name: Build
run: |
source /opt/rh/gcc-toolset-13/enable
source /opt/rh/devtoolset-10/enable
cmake --build build --config ${{ env.BUILD_TYPE }}

- name: Cleanup
run: |
rm -rf ./deps
rm -rf ./buildtrees

- name: Test
working-directory: ${{ github.workspace }}/build
run: ctest -C ${{ env.BUILD_TYPE }}

- name: Unit Test
working-directory: ${{ github.workspace }}
run: ./pikatests.sh all clean
run: ./pikatests.sh all
cheniujh marked this conversation as resolved.
Show resolved Hide resolved

- name: Start codis, pika master and pika slave
working-directory: ${{ github.workspace }}/build
Expand All @@ -145,7 +135,6 @@ jobs:
../tests/integration/start_master_and_slave.sh
chmod +x ../tests/integration/start_codis.sh
../tests/integration/start_codis.sh

- name: Run Go E2E Tests
working-directory: ${{ github.workspace }}/build
run: |
Expand All @@ -155,6 +144,78 @@ jobs:
chmod +x integrate_test.sh
sh integrate_test.sh


# build_on_rocky:
# runs-on: ubuntu-latest
# container:
# image: rockylinux:9
#
# steps:
# - name: Install deps
# run: |
# dnf update -y
# dnf install -y bash cmake wget git autoconf gcc perl-Digest-SHA tcl which tar g++ tar epel-release gcc-c++ libstdc++-devel gcc-toolset-13
#
# - name: Set up Go
# uses: actions/setup-go@v5
# with:
# go-version: 1.19
#
# - name: Checkout
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
#
# - name: Configure CMake
# run: |
# source /opt/rh/gcc-toolset-13/enable
# cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DUSE_PIKA_TOOLS=ON -DCMAKE_CXX_FLAGS_DEBUG=-fsanitize=address .
#
# - uses: actions/cache@v3
# with:
# path: ${{ github.workspace }}/deps
# key: ${{ runner.os }}-rocky-deps-${{ hashFiles('**/CMakeLists.txt') }}
#
# - uses: actions/cache@v3
# with:
# path: ${{ github.workspace }}/buildtrees
# key: ${{ runner.os }}-rocky-buildtrees-${{ hashFiles('**/CMakeLists.txt') }}
#
# - name: Build
# run: |
# source /opt/rh/gcc-toolset-13/enable
# cmake --build build --config ${{ env.BUILD_TYPE }}
#
# - name: Cleanup
# run: |
# rm -rf ./deps
# rm -rf ./buildtrees
#
# - name: Test
# working-directory: ${{ github.workspace }}/build
# run: ctest -C ${{ env.BUILD_TYPE }}
#
# - name: Unit Test
# working-directory: ${{ github.workspace }}
# run: ./pikatests.sh all clean
#
# - name: Start codis, pika master and pika slave
# working-directory: ${{ github.workspace }}/build
# run: |
# chmod +x ../tests/integration/start_master_and_slave.sh
# ../tests/integration/start_master_and_slave.sh
# chmod +x ../tests/integration/start_codis.sh
# ../tests/integration/start_codis.sh
#
# - name: Run Go E2E Tests
# working-directory: ${{ github.workspace }}/build
# run: |
# cd ../tools/pika_keys_analysis/
# go test -v ./...
# cd ../../tests/integration/
# chmod +x integrate_test.sh
# sh integrate_test.sh

cheniujh marked this conversation as resolved.
Show resolved Hide resolved
build_on_macos:

runs-on: macos-13
Expand Down
Loading