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

Cross repo ci #472

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,21 @@ on:
branches:
- develop
- master
workflow_dispatch:

jobs:

# Set the PIC tag if the job is dispatched by PIC CI.
set-pic-tag:
runs-on: ubuntu-latest
steps:
- name: Set KVS PIC Tag for PIC-CI-Triggered Runs
id: set_pic_tag
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "KVS_PIC_TAG=${{ github.event.inputs.pic_tag }}" >> $GITHUB_ENV
fi

clang-format-check:
runs-on: macos-latest
steps:
Expand All @@ -25,6 +39,8 @@ jobs:

mac-os-build-gcc:
runs-on: macos-13
# TODO: WIll need to set this for all the jobs we want to run upon the PIC dispatch.
needs: set-pic-tag
permissions:
id-token: write
contents: read
Expand All @@ -40,7 +56,17 @@ jobs:
brew install pkgconfig
brew unlink openssl # it seems the libcurl is trying to access this openssl despite explicitly setting it to our build
mkdir build && cd build
cmake .. --trace -DBUILD_TEST=TRUE

# Setting PIC dependency tag if it is provided by a PIC-CI-triggered job.
CMAKE_ARGS="-DBUILD_TEST=TRUE"
if [ -n "${KVS_PIC_TAG}" ]; then
echo "Setting -DKVS_PIC_TAG to: ${KVS_PIC_TAG}"
CMAKE_ARGS="${CMAKE_ARGS} -DKVS_PIC_TAG=${KVS_PIC_TAG}"
else
echo "Not setting -DKVS_PIC_TAG."
fi

cmake .. --trace $CMAKE_ARGS
make
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
Expand Down
9 changes: 8 additions & 1 deletion CMake/Dependencies/libkvspic-CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@ project(libkvspic-download LANGUAGES C)

include(ExternalProject)

if(NOT KVS_PIC_GIT_TAG)
set(KVS_PIC_GIT_TAG v1.2.0)
message("KVS_PIC_GIT_TAG was not defined")
else()
message("KVS_PIC_GIT_TAG was defined")
endif()

# clone repo only
ExternalProject_Add(libkvspic-download
GIT_REPOSITORY https://github.com/awslabs/amazon-kinesis-video-streams-pic.git
GIT_TAG v1.2.0
GIT_TAG ${KVS_PIC_GIT_TAG}
SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/kvspic-src"
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/kvspic-build"
CMAKE_ARGS
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ else()
############# fetch repos that we need do add_subdirectory ############
# repos that we will build using add_subdirectory will be stored in this path
set(DEPENDENCY_DOWNLOAD_PATH ${CMAKE_CURRENT_SOURCE_DIR}/dependency)
set(BUILD_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})
set(BUILD_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DKVS_PIC_GIT_TAG=${KVS_PIC_GIT_TAG})
fetch_repo(kvspic ${BUILD_ARGS})
add_subdirectory("${DEPENDENCY_DOWNLOAD_PATH}/libkvspic/kvspic-src")
file(GLOB PIC_HEADERS "${pic_project_SOURCE_DIR}/src/*/include")
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ You can pass the following options to `cmake ..`.
* `-DALIGNED_MEMORY_MODEL` Build for aligned memory model only devices. Default is OFF.
* `-DLOCAL_OPENSSL_BUILD` Whether or not to use local OpenSSL build. Default is OFF.
* `-DCONSTRAINED_DEVICE` -- Change thread stack size to 0.5Mb, needed for Alpine.
* `-DKVS_PIC_GIT_TAG` -- Change the KVS PIC GitHub tag to use.


DMEMORY_SANITIZER, DTHREAD_SANITIZER etc. flags works only with clang compiler
Expand Down
Loading