-
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
c2a56a3
commit 25b3ea3
Showing
11 changed files
with
192 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,56 @@ | ||
name: Build and test Package | ||
|
||
on: | ||
push: | ||
schedule: | ||
- cron: '30 5 * * *' | ||
workflow_dispatch: | ||
inputs: | ||
ref: | ||
description: "Commit hash" | ||
default: "" | ||
|
||
jobs: | ||
codeql: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{inputs.ref}} | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: c-cpp | ||
|
||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v2 | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 | ||
with: | ||
category: c-cpp | ||
|
||
build: | ||
needs: [codeql] | ||
runs-on: ubuntu-latest | ||
container: amazonlinux:2 | ||
strategy: | ||
matrix: | ||
build_type: [debug, relwithdebinfo] | ||
steps: | ||
- name: Set up Dev Environment | ||
run: | | ||
yum groupinstall -y "Development Tools" | ||
yum install -y cmake3 valgrind git | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{inputs.ref}} | ||
|
||
- name: Build and Test | ||
run: | | ||
cmake3 -S . -B build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} | ||
cd build | ||
make package | ||
make 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,37 @@ | ||
name: Publish pre-release Package | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
ref: | ||
description: "Commit hash" | ||
default: "" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
container: amazonlinux:2 | ||
strategy: | ||
matrix: | ||
build_type: [relwithdebinfo] | ||
steps: | ||
- name: Set up Dev Environment | ||
run: | | ||
yum groupinstall -y "Development Tools" | ||
yum install -y cmake3 valgrind git | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{inputs.ref}} | ||
|
||
- 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 | ||
with: | ||
name: Pre-release | ||
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,56 @@ | ||
name: Publish release Package | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: "Release version (major.minor.patch)" | ||
required: true | ||
ref: | ||
description: "Commit hash" | ||
default: "" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
container: amazonlinux:2 | ||
strategy: | ||
matrix: | ||
build_type: [relwithdebinfo] | ||
steps: | ||
- name: Set up Dev Environment | ||
run: | | ||
yum groupinstall -y "Development Tools" | ||
yum install -y cmake3 valgrind git | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{inputs.ref}} | ||
|
||
- name: Build and Test | ||
run: | | ||
cmake3 -S . -B build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DRELEASE_VERSION=${{inputs.version}} | ||
cd build | ||
make package | ||
make test | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
tag_name: v${{ inputs.version }} | ||
release_name: v${{ inputs.version }} | ||
draft: true | ||
prerelease: false | ||
|
||
- name: upload linux artifact | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: build/vsock-bridge-${{inputs.version}}.tar.gz | ||
asset_name: vsock-bridge-${{inputs.version}}.tar.gz | ||
asset_content_type: application/tar+gzip |
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,17 @@ | ||
cmake_minimum_required (VERSION 3.8) | ||
|
||
project ("vsock-bridge") | ||
if (NOT DEFINED RELEASE_VERSION) | ||
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) |