-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UID2-2349 Add build pipeline for aws vsock proxy
- first cut: basic build/test/package workflow
- Loading branch information
1 parent
b6e50ed
commit fed7999
Showing
9 changed files
with
76 additions
and
72 deletions.
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,31 @@ | ||
name: Build/Test/Package | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
container: amazonlinux:2 | ||
strategy: | ||
matrix: | ||
build_type: [debug, relwithdebinfo] | ||
steps: | ||
- name: Dev environment | ||
run: | | ||
yum groupinstall -y "Development Tools" | ||
yum install -y cmake3 valgrind git | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Build and Test | ||
run: | | ||
cmake3 -S . -B build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} | ||
cd build | ||
make package | ||
make test | ||
- uses: actions/upload-artifact@v3 | ||
if: matrix.build_type == 'release' | ||
with: | ||
name: vsock-bridge.tar.gz | ||
path: build/*.tar.gz |
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,2 @@ | ||
build | ||
.idea |
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 |
---|---|---|
@@ -1,7 +1,19 @@ | ||
cmake_minimum_required (VERSION 3.8) | ||
|
||
project ("vsock-bridge") | ||
if (DEFINED ENV{RELEASE_VERSION}) | ||
set (RELEASE_VERSION "$ENV{RELEASE_VERSION}") | ||
else () | ||
set (RELEASE_VERSION "0.0.0") | ||
endif () | ||
|
||
set(CMAKE_CXX_FLAGS_DEBUG "-ggdb") | ||
project ("vsock-bridge" VERSION ${RELEASE_VERSION}) | ||
|
||
add_compile_options ("$<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:-ggdb>") | ||
set (CXX_STANDARD 17) | ||
enable_testing () | ||
|
||
set (CPACK_GENERATOR "TGZ") | ||
set (CPACK_PACKAGE_FILE_NAME "vsock-bridge-${RELEASE_VERSION}") | ||
include (CPack) | ||
|
||
add_subdirectory ("vsock-bridge") |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
# CMakeList.txt : CMake project for vsock-bridge, include source and define | ||
# project specific logic here. | ||
# | ||
cmake_minimum_required (VERSION 3.8) | ||
|
||
configure_file (include/version.h.in include/version.h) | ||
add_subdirectory (src) | ||
|
||
enable_testing () | ||
add_subdirectory (test) | ||
add_subdirectory (test) |
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,3 @@ | ||
#pragma once | ||
|
||
#define VSOCK_BRIDGE_VERSION "@PROJECT_VERSION@" |
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 |
---|---|---|
@@ -1,12 +1,11 @@ | ||
cmake_minimum_required (VERSION 3.8) | ||
|
||
add_library (vsock-io "socket.cpp" "logger.cpp" "epoll_poller.cpp") | ||
|
||
add_executable (vsock-bridge "vsock-bridge.cpp" "config.cpp" "global.cpp") | ||
target_link_libraries(vsock-bridge vsock-io pthread -static-libgcc -static-libstdc++) | ||
target_link_libraries (vsock-bridge vsock-io pthread -static-libgcc -static-libstdc++) | ||
|
||
target_include_directories(vsock-io PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../include) | ||
target_include_directories(vsock-bridge PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../include) | ||
target_include_directories (vsock-io PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../include) | ||
target_include_directories (vsock-bridge | ||
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../include | ||
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../include) | ||
|
||
set_property(TARGET vsock-io PROPERTY CXX_STANDARD 17) | ||
set_property(TARGET vsock-bridge PROPERTY CXX_STANDARD 17) | ||
install(TARGETS vsock-bridge DESTINATION bin) |
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 |
---|---|---|
@@ -1,11 +1,5 @@ | ||
cmake_minimum_required (VERSION 3.8) | ||
add_executable (vsock-bridge-tests testmain.cpp) | ||
target_include_directories (vsock-bridge-tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../include) | ||
target_link_libraries (vsock-bridge-tests vsock-io pthread) | ||
|
||
include_directories (tests | ||
${CMAKE_CURRENT_SOURCE_DIR}/../include | ||
) | ||
|
||
add_executable (tests testmain.cpp) | ||
|
||
target_link_libraries (tests vsock-io pthread) | ||
|
||
add_test (NAME VSockTest COMMAND tests) | ||
add_test (vsock-bridge-tests vsock-bridge-tests) |