-
Notifications
You must be signed in to change notification settings - Fork 120
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
Use github self-hosted runner for CI #169
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Linux ARM | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
centos8-gcc921-epoll: | ||
runs-on: [self-hosted, Linux, ARM64] | ||
|
||
container: | ||
image: dokken/centos-stream-8:sha-40294ce | ||
options: --cpus 4 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install Dependencies | ||
run: | | ||
dnf install -y git gcc-c++ cmake | ||
dnf install -y gcc-toolset-9-gcc-c++ | ||
dnf install -y openssl-devel libcurl-devel libaio-devel | ||
dnf install -y epel-release | ||
dnf install -y fuse-devel libgsasl-devel | ||
|
||
- name: Build | ||
run: | | ||
source /opt/rh/gcc-toolset-9/enable | ||
cmake -B build -D BUILD_TESTING=ON -D CMAKE_BUILD_TYPE=RelWithDebInfo \ | ||
-D ENABLE_SASL=ON -D ENABLE_FUSE=ON \ | ||
-D ENABLE_URING=OFF -D FETCH_GTEST_GFLAGS_SOURCE=ON | ||
cmake --build build | ||
|
||
- name: Test | ||
run: | | ||
ulimit -l unlimited | ||
cd build | ||
ctest --timeout 3600 -V |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: Linux x86 | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
centos8-gcc921-epoll: | ||
runs-on: [self-hosted, Linux, X64] | ||
|
||
container: | ||
image: dokken/centos-stream-8:sha-40294ce | ||
options: --cpus 4 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install Dependencies | ||
run: | | ||
dnf install -y git gcc-c++ cmake | ||
dnf install -y gcc-toolset-9-gcc-c++ | ||
dnf install -y openssl-devel libcurl-devel libaio-devel | ||
dnf install -y epel-release | ||
dnf install -y fuse-devel libgsasl-devel | ||
|
||
- name: Build | ||
run: | | ||
source /opt/rh/gcc-toolset-9/enable | ||
cmake -B build -D BUILD_TESTING=ON -D CMAKE_BUILD_TYPE=RelWithDebInfo \ | ||
-D ENABLE_SASL=ON -D ENABLE_FUSE=ON \ | ||
-D ENABLE_URING=OFF -D FETCH_GTEST_GFLAGS_SOURCE=ON | ||
cmake --build build | ||
|
||
- name: Test | ||
run: | | ||
ulimit -l unlimited | ||
cd build | ||
ctest --timeout 3600 -V | ||
|
||
centos8-gcc921-iouring: | ||
runs-on: [self-hosted, Linux, X64] | ||
|
||
container: | ||
image: dokken/centos-stream-8:sha-40294ce | ||
# In order to run io_uring, the docker daemon should add --default-ulimit memlock=-1:-1 | ||
options: --cpus 4 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install Dependencies | ||
run: | | ||
dnf install -y git gcc-c++ cmake | ||
dnf install -y gcc-toolset-9-gcc-c++ | ||
dnf install -y openssl-devel libcurl-devel libaio-devel | ||
dnf install -y epel-release | ||
dnf install -y fuse-devel libgsasl-devel | ||
|
||
- name: Build | ||
run: | | ||
source /opt/rh/gcc-toolset-9/enable | ||
cmake -B build -D BUILD_TESTING=ON -D CMAKE_BUILD_TYPE=RelWithDebInfo \ | ||
-D ENABLE_SASL=ON -D ENABLE_FUSE=ON \ | ||
-D ENABLE_URING=ON -D FETCH_GTEST_GFLAGS_SOURCE=ON | ||
cmake --build build | ||
|
||
- name: Test | ||
run: | | ||
ulimit -l unlimited | ||
cd build | ||
ctest --timeout 3600 -V |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ project( | |
include(FindPackageHandleStandardArgs) | ||
include(CheckCXXCompilerFlag) | ||
include(FetchContent) | ||
include(ProcessorCount) | ||
set(FETCHCONTENT_QUIET false) | ||
find_package(PkgConfig REQUIRED) | ||
|
||
|
@@ -23,24 +24,27 @@ option(FETCH_GTEST_GFLAGS_SOURCE "Fetch gtest, gmock and gflags source code. Lin | |
option(ENABLE_FSTACK_DPDK "Use f-stack + DPDK as the event engine" OFF) | ||
option(ENABLE_EXTFS "enable extfs" OFF) | ||
|
||
# Get CPU arch | ||
# Get CPU arch and number | ||
execute_process(COMMAND uname -m OUTPUT_VARIABLE ARCH OUTPUT_STRIP_TRAILING_WHITESPACE) | ||
if (NOT (${ARCH} STREQUAL x86_64) AND NOT (${ARCH} STREQUAL aarch64) AND NOT (${ARCH} STREQUAL arm64)) | ||
message(FATAL_ERROR "Unknown CPU architecture ${ARCH}") | ||
endif () | ||
ProcessorCount(NumCPU) | ||
|
||
# Compiler options | ||
add_compile_options(-Wall) # -Werror is not enable yet | ||
|
||
set(CMAKE_CXX_STANDARD 14) | ||
set(CMAKE_CXX_STANDARD_REQUIRED on) | ||
set(CMAKE_CXX_EXTENSIONS off) | ||
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") | ||
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG") | ||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG") | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
# CMake didn't provide an abstraction of optimization level for now. | ||
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") # For development | ||
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG") # For production | ||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g") # For CI test | ||
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. CI 现在使用-O3编译 |
||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
set(CMAKE_BUILD_RPATH_USE_ORIGIN on) | ||
set(CMAKE_POSITION_INDEPENDENT_CODE on) | ||
set(CMAKE_BUILD_RPATH_USE_ORIGIN ON) | ||
set(CMAKE_POSITION_INDEPENDENT_CODE ON) | ||
set(CMAKE_BUILD_PARALLEL_LEVEL ${NumCPU}) | ||
|
||
if (${ARCH} STREQUAL x86_64) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.2") | ||
|
@@ -125,7 +129,8 @@ if (ENABLE_EXTFS) | |
find_package(e2fs REQUIRED) | ||
endif() | ||
|
||
if (FETCH_GTEST_GFLAGS_SOURCE) | ||
function(do_fetch_gtest_gflags_src) | ||
set(BUILD_TESTING OFF) # Only disable in this function | ||
FetchContent_Declare( | ||
gflags | ||
GIT_REPOSITORY https://github.com/gflags/gflags.git | ||
|
@@ -141,6 +146,10 @@ if (FETCH_GTEST_GFLAGS_SOURCE) | |
GIT_TAG release-1.12.1 | ||
) | ||
FetchContent_MakeAvailable(googletest) | ||
endfunction() | ||
|
||
if (FETCH_GTEST_GFLAGS_SOURCE) | ||
do_fetch_gtest_gflags_src() | ||
endif() | ||
|
||
# Compile photon objects | ||
|
@@ -274,15 +283,15 @@ target_link_libraries(photon_static ${static_link_libs}) | |
if (BUILD_TESTING) | ||
include(CTest) | ||
|
||
if (FETCH_GTEST_GFLAGS_SOURCE) | ||
set(testing_libs gtest gmock gflags::gflags) | ||
else() | ||
find_package(GTest REQUIRED) | ||
find_package(gmock REQUIRED) | ||
find_package(gflags REQUIRED) | ||
set(testing_libs ${GTEST_BOTH_LIBRARIES} ${GMOCK_LIBRARIES} ${GFLAGS_LIBRARIES}) | ||
include_directories(${GTEST_INCLUDE_DIRS} ${GMOCK_INCLUDE_DIRS} ${GFLAGS_INCLUDE_DIRS}) | ||
endif() | ||
if (FETCH_GTEST_GFLAGS_SOURCE) | ||
set(testing_libs gtest gmock gflags::gflags) | ||
else () | ||
find_package(GTest REQUIRED) | ||
find_package(gmock REQUIRED) | ||
find_package(gflags REQUIRED) | ||
set(testing_libs ${GTEST_BOTH_LIBRARIES} ${GMOCK_LIBRARIES} ${GFLAGS_LIBRARIES}) | ||
include_directories(${GTEST_INCLUDE_DIRS} ${GMOCK_INCLUDE_DIRS} ${GFLAGS_INCLUDE_DIRS}) | ||
endif () | ||
|
||
add_subdirectory(examples) | ||
add_subdirectory(common/checksum/test) | ||
|
@@ -294,8 +303,8 @@ endif() | |
add_subdirectory(rpc/test) | ||
add_subdirectory(thread/test) | ||
add_subdirectory(net/security-context/test) | ||
if (ENABLE_EXTFS) | ||
add_subdirectory(fs/extfs/test) | ||
endif () | ||
if (ENABLE_EXTFS) | ||
add_subdirectory(fs/extfs/test) | ||
endif () | ||
|
||
endif () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,7 +64,7 @@ brew install cmake openssl pkg-config | |
```bash | ||
cd PhotonLibOS | ||
cmake -B build | ||
cmake --build build -j | ||
cmake --build build | ||
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. cmake默认的编译并发数是32,小配置机器用默认值很容易OOM,因此采用检测cpu数的方法,并作为新的默认值 |
||
``` | ||
|
||
```mdx-code-block | ||
|
@@ -75,7 +75,7 @@ cmake --build build -j | |
```bash | ||
cd PhotonLibOS | ||
cmake -B build | ||
cmake --build build -j | ||
cmake --build build | ||
``` | ||
|
||
```mdx-code-block | ||
|
@@ -87,7 +87,7 @@ cmake --build build -j | |
cd PhotonLibOS | ||
# Use `brew info openssl` to find openssl path | ||
cmake -B build -D OPENSSL_ROOT_DIR=/path/to/openssl/ | ||
cmake --build build -j | ||
cmake --build build | ||
``` | ||
|
||
```mdx-code-block | ||
|
@@ -110,11 +110,12 @@ The examples and test code are built together. | |
|
||
```bash | ||
# Install additional dependencies | ||
dnf install epel-releaase | ||
dnf install gtest-devel gmock-devel gflags-devel fuse-devel libgsasl-devel | ||
|
||
# Build examples and test code | ||
cmake -B build -D BUILD_TESTING=1 -D CMAKE_BUILD_TYPE=Debug | ||
cmake --build build -j | ||
cmake -B build -D BUILD_TESTING=ON | ||
cmake --build build | ||
|
||
# Run all test cases | ||
cd build | ||
|
@@ -131,8 +132,8 @@ ctest | |
apt install libgtest-dev libgmock-dev libgflags-dev libfuse-dev libgsasl7-dev | ||
|
||
# Build examples and test code | ||
cmake -B build -D BUILD_TESTING=1 -D CMAKE_BUILD_TYPE=Debug | ||
cmake --build build -j | ||
cmake -B build -D BUILD_TESTING=ON | ||
cmake --build build | ||
|
||
# Run all test cases | ||
cd build | ||
|
@@ -149,8 +150,8 @@ ctest | |
brew install gflags googletest gsasl | ||
|
||
# Build examples and test code | ||
cmake -B build -D BUILD_TESTING=1 -D CMAKE_BUILD_TYPE=Debug | ||
cmake --build build -j | ||
cmake -B build -D BUILD_TESTING=ON | ||
cmake --build build | ||
|
||
# Run all test cases | ||
cd build | ||
|
@@ -173,4 +174,4 @@ ctest | |
| ENABLE_FUSE | OFF | Enable fuse. Requires `libfuse` | | ||
| ENABLE_SASL | OFF | Enable SASL. Requires `libgsasl` | | ||
| ENABLE_FSTACK_DPDK | OFF | Enable F-Stack and DPDK. Requires both. | | ||
| ENABLE_EXTFS | OFF | Enable extfs. Requires `libe2fs` | | ||
| ENABLE_EXTFS | OFF | Enable extfs. Requires `libe2fs` | |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
RedHat不再给docker hub提供官方镜像,只提供在自己的quary.io仓库 ...