-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Supports CI running on Centos #1745
Changes from all commits
48bc4b5
1a070a3
951a952
ac034af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,8 @@ env: | |
BUILD_TYPE: RelWithDebInfo | ||
|
||
jobs: | ||
build: | ||
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. | ||
build_on_ubuntu: | ||
# The CMake configure and build commands are platform-agnostic and should work equally well on Windows or Mac. | ||
# You can convert this to a matrix build if you need cross-platform coverage. | ||
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | ||
runs-on: ubuntu-latest | ||
|
@@ -72,25 +72,28 @@ jobs: | |
|
||
|
||
build_on_centos: | ||
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. | ||
# The CMake configure and build commands are platform-agnostic and should work equally well on Windows or Mac. | ||
# You can convert this to a matrix build if you need cross-platform coverage. | ||
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | ||
runs-on: ubuntu-latest | ||
container: | ||
image: centos:7 | ||
container: docker.io/centos:7 | ||
|
||
steps: | ||
- name: Install deps | ||
uses: actions/checkout@v2 | ||
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. | ||
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type | ||
run: | | ||
yum install -y wget tar gcc automake autoconf libtool make | ||
yum install -y wget git autoconf centos-release-scl | ||
yum install -y devtoolset-10-gcc devtoolset-10-gcc-c++ devtoolset-10-make devtoolset-10-bin-util | ||
yum install -y llvm-toolset-7 | ||
yum install -y llvm-toolset-7-clang | ||
source /opt/rh/devtoolset-10/enable | ||
gcc --version | ||
make --version | ||
yum install -y python3 | ||
python3 --version | ||
python3 -m pip install redis | ||
|
||
|
||
- name: Install cmake | ||
|
@@ -128,4 +131,25 @@ jobs: | |
cd ${{github.workspace}}/build | ||
source /opt/rh/devtoolset-10/enable | ||
ctest -C ${{env.BUILD_TYPE}} | ||
|
||
- name: Unit Test | ||
working-directory: ${{github.workspace}} | ||
run: | | ||
cd ${{github.workspace}} | ||
chmod +x ./pikatests.sh all | ||
./pikatests.sh all | ||
|
||
# master on port 9221, slave on port 9231, all with 2 db | ||
- name: Start pika master and slave | ||
working-directory: ${{github.workspace}}/build | ||
run: | | ||
cd ${{github.workspace}}/build | ||
chmod +x ../tests/integration/start_master_and_slave.sh | ||
../tests/integration/start_master_and_slave.sh | ||
|
||
- name: Run Python E2E Tests | ||
working-directory: ${{github.workspace}}/build | ||
run: | | ||
cd ${{github.workspace}}/build | ||
python3 ../tests/integration/pika_replication_test.py | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here are some suggestions for the code patch:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Overall, the code patch looks fine, but here are a few suggestions for improvement and potential bug risks:
Remember to thoroughly test these workflow steps and verify that dependencies, scripts, and test files are correctly set up to achieve the desired outcomes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Based on the code patch, here are some observations and suggestions:
Overall, the code patch seems to include necessary build steps, dependency installations, and test executions. Ensure that the referenced scripts exist, are accessible, and have been thoroughly tested to reduce the risk of bugs. Labeling or organizing the code review sections would further improve readability and clarity of the review process. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are some observations and suggestions for the code patch:
In the first job (
build_on_ubuntu
), the lineruns-on: ubuntu-latest
can be kept since it indicates that the job will run on an Ubuntu environment.It's a good practice to echo the value of
${{github.workspace}}
before running commands in theUnit Test
step. This can help with troubleshooting and ensure the correct directory is being used.Consider adding more descriptive names to the jobs to improve readability and understanding of their purpose.
In the
build_on_centos
job, the linecontainer:image:centos:7
has been removed, but there is no alternative provided. If there is a specific reason for this change, make sure to address it or find an appropriate substitution if necessary.In the
Install deps
step, consider specifying the version ofyum install
command to ensure reproducibility and compatibility with the required dependencies.The
Install cmake
step could benefit from specifying a version as well to ensure consistency.It's a good practice to include cleanup steps after the build process, such as removing unnecessary files, cleaning up temporary resources, or deleting any artifacts that are not needed.
In the
Run CTest
step, consider including theBUILD_TYPE
environment variable when runningctest
to ensure consistency with the build configuration.For the
Unit Test
,Start pika master and slave
, andRun Python E2E Tests
steps, consider using the full path to the scripts or ensuring that the working directory has already been set correctly.Ensure that any sensitive information or credentials are properly protected and not exposed within the code patch or workflow file.
Consider incorporating automated testing frameworks such as static analysis tools, unit tests, and linting tools into the workflow.
Keep in mind these suggestions may vary based on the specific requirements and context of the project.