Skip to content

Commit

Permalink
Merge branch 'server-side' into rlamb/common-persistent-store
Browse files Browse the repository at this point in the history
  • Loading branch information
cwaldren-ld committed Sep 6, 2023
2 parents a76b3a8 + 1db6db9 commit 20abc69
Show file tree
Hide file tree
Showing 169 changed files with 7,506 additions and 1,228 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
# This is a composite workflow that an generate all the release artifacts
# for the C++ client SDK.
# for the C++ client-side & server-side SDKs.

# This can be ran automatically with the tag_name output from release-please,
# or ran triggered manually with a user provided tag.

name: C++ Client Release
description: C++ Client Release Process
name: C++ SDK Release
description: C++ SDK Release Process
inputs:
tag_name:
description: 'The tag name of the release to upload artifacts to.'
required: true
github_token:
description: 'The GitHub token to use for uploading artifacts.'
required: true
sdk_path:
description: 'Path to the sdk, e.g. libs/client-sdk.'
required: true
sdk_cmake_target:
description: 'CMake target of the sdk, e.g. launchdarkly-cpp-client.'

runs:
using: composite
Expand All @@ -28,10 +34,10 @@ runs:
run: |
sudo apt-get install doxygen
sudo apt-get install graphviz
./scripts/build-release.sh launchdarkly-cpp-client
./scripts/build-docs.sh libs/client-sdk
./scripts/build-release.sh ${{ inputs.sdk_cmake_target }}
./scripts/build-docs.sh ${{ inputs.sdk_path }}
env:
WORKSPACE: libs/client-sdk
WORKSPACE: ${{ inputs.sdk_path }}
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}

- name: Archive Release Linux - GCC/x64/Static
Expand Down Expand Up @@ -64,7 +70,7 @@ runs:
if: runner.os == 'Linux'
uses: ./.github/actions/publish-docs
with:
workspace_path: libs/client-sdk
workspace_path: ${{ inputs.sdk_path }}

- name: Configure MSVC
if: runner.os == 'Windows'
Expand All @@ -74,11 +80,11 @@ runs:
if: runner.os == 'Windows'
shell: bash
env:
OPENSSL_ROOT_DIR: ${{ env.OPENSSL_ROOT_DIR }}
OPENSSL_ROOT_DIR: 'C:\Program Files\OpenSSL'
BOOST_LIBRARY_DIR: 'C:\local\boost_1_81_0\lib64-msvc-14.3'
BOOST_LIBRARYDIR: 'C:\local\boost_1_81_0\lib64-msvc-14.3'
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
run: ./scripts/build-windows.sh launchdarkly-cpp-client
run: ./scripts/build-windows.sh ${{ inputs.sdk_cmake_target }}

- name: Archive Release Windows - MSVC/x64/Static
if: runner.os == 'Windows'
Expand Down Expand Up @@ -130,9 +136,9 @@ runs:
echo "OPENSSL_ROOT_DIR=$(brew --prefix [email protected])" >> "$GITHUB_ENV"
export OPENSSL_ROOT_DIR=$(brew --prefix [email protected])
./scripts/build-release.sh launchdarkly-cpp-client
./scripts/build-release.sh ${{ inputs.sdk_cmake_target }}
env:
WORKSPACE: libs/client-sdk
WORKSPACE: ${{ inputs.sdk_path }}
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}

- name: Archive Release Mac - AppleClang/x64/Static
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,28 @@ jobs:
env:
# Port the test service (implemented in this repo) should bind to.
TEST_SERVICE_PORT: 8123
TEST_SERVICE_BINARY: ./build/contract-tests/sdk-contract-tests/sdk-tests
TEST_SERVICE_BINARY: ./build/contract-tests/client-contract-tests/client-tests
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/ci
with:
cmake_target: sdk-tests
cmake_target: client-tests
run_tests: false
- name: 'Launch test service as background task'
run: $TEST_SERVICE_BINARY $TEST_SERVICE_PORT 2>&1 &
- uses: ./.github/actions/contract-tests
with:
# Inform the test harness of test service's port.
test_service_port: ${{ env.TEST_SERVICE_PORT }}
extra_params: '-skip-from ./contract-tests/sdk-contract-tests/test-suppressions.txt'
build-test:
extra_params: '-skip-from ./contract-tests/client-contract-tests/test-suppressions.txt'
build-test-client:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/ci
with:
cmake_target: launchdarkly-cpp-client
build-test-mac:
build-test-client-mac:
runs-on: macos-12
steps:
- run: |
Expand All @@ -52,14 +52,14 @@ jobs:
with:
cmake_target: launchdarkly-cpp-client
platform_version: 12
build-test-windows:
build-test-client-windows:
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
- uses: ilammy/msvc-dev-cmd@v1
- uses: ./.github/actions/ci
env:
OPENSSL_ROOT_DIR: ${{ env.OPENSSL_ROOT_DIR }}
OPENSSL_ROOT_DIR: 'C:\Program Files\OpenSSL'
BOOST_LIBRARY_DIR: 'C:\local\boost_1_81_0\lib64-msvc-14.3'
BOOST_LIBRARYDIR: 'C:\local\boost_1_81_0\lib64-msvc-14.3'
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- '**.md'

jobs:
build-test:
build-test-common:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/internal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- '**.md'

jobs:
build-test:
build-test-internal:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
Expand Down
29 changes: 0 additions & 29 deletions .github/workflows/manual-client-release-artifacts.yml

This file was deleted.

52 changes: 52 additions & 0 deletions .github/workflows/manual-sdk-release-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Checks out the tag, builds release builds, and attaches them to the release for the tag.
# If you need to change build scripts, then update the tag to include the modifications.
on:
workflow_dispatch:
inputs:
tag:
description: 'The tag to create release artifacts for.'
required: true
sdk_target:
description: 'The library/cmake target to release (delimited by ":").'
required: true
default: 'libs/client-sdk:launchdarkly-cpp-client'
type: choice
options:
- libs/client-sdk:launchdarkly-cpp-client

name: Publish SDK Artifacts

jobs:
split-input:
runs-on: ubuntu-latest
outputs:
sdk_path: ${{ steps.split-string.outputs.SDK_PATH }}
sdk_cmake_target: ${{ steps.split-string.outputs.SDK_CMAKE_TARGET }}
steps:
- name: Determine CMake target and SDK library path
id: split-string
run: |
INPUT="${{ inputs.sdk_target }}"
IFS=':' read -ra PATH_AND_TARGET <<< "$INPUT"
echo "SDK_PATH=${PATH_AND_TARGET[0]}" >> $GITHUB_OUTPUT
echo "SDK_CMAKE_TARGET=${PATH_AND_TARGET[1]}" >> $GITHUB_OUTPUT
release-sdk:
needs: split-input
strategy:
matrix:
# Each of the platforms for which release-artifacts need generated.
os: [ ubuntu-latest, windows-2022, macos-12 ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.tag }}
- id: release-sdk
name: Full release of ${{ needs.split-input.outputs.sdk_path }}
uses: ./.github/actions/sdk-release
with:
# The tag of the release to upload artifacts to.
tag_name: ${{ inputs.tag }}
github_token: ${{secrets.GITHUB_TOKEN}}
sdk_path: ${{ needs.split-input.outputs.sdk_path}}
sdk_cmake_target: ${{ needs.split-input.outputs.sdk_cmake_target}}
4 changes: 3 additions & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ jobs:
- uses: actions/checkout@v3
- id: release-client
name: Full release of libs/client-sdk
uses: ./.github/actions/client-release
uses: ./.github/actions/sdk-release
with:
# The tag of the release to upload artifacts to.
tag_name: ${{ needs.release-please.outputs.package-client-tag }}
github_token: ${{secrets.GITHUB_TOKEN}}
sdk_path: 'libs/client-sdk'
sdk_cmake_target: 'launchdarkly-cpp-client'
68 changes: 68 additions & 0 deletions .github/workflows/server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: libs/server-sdk

on:
push:
branches: [ main ]
paths-ignore:
- '**.md' #Do not need to run CI for markdown changes.
pull_request:
branches: [ main, server-side ]
paths-ignore:
- '**.md'

jobs:
contract-tests:
runs-on: ubuntu-22.04
env:
# Port the test service (implemented in this repo) should bind to.
TEST_SERVICE_PORT: 8123
TEST_SERVICE_BINARY: ./build/contract-tests/server-contract-tests/server-tests
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/ci
with:
cmake_target: server-tests
run_tests: false
- name: 'Launch test service as background task'
run: $TEST_SERVICE_BINARY $TEST_SERVICE_PORT 2>&1 &
- uses: ./.github/actions/contract-tests
with:
# Inform the test harness of test service's port.
test_service_port: ${{ env.TEST_SERVICE_PORT }}
extra_params: '-skip-from ./contract-tests/server-contract-tests/test-suppressions.txt'
build-test-server:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/ci
with:
cmake_target: launchdarkly-cpp-server
build-test-server-mac:
runs-on: macos-12
steps:
- run: |
brew link --overwrite [email protected]
echo "OPENSSL_ROOT_DIR=$(brew --prefix [email protected])" >> "$GITHUB_ENV"
# For debugging
echo "OPENSSL_ROOT_DIR=$(brew --prefix [email protected])"
- uses: actions/checkout@v3
- uses: ./.github/actions/ci
env:
OPENSSL_ROOT_DIR: ${{ env.OPENSSL_ROOT_DIR }}
with:
cmake_target: launchdarkly-cpp-server
platform_version: 12
build-test-server-windows:
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
- uses: ilammy/msvc-dev-cmd@v1
- uses: ./.github/actions/ci
env:
OPENSSL_ROOT_DIR: 'C:\Program Files\OpenSSL'
BOOST_LIBRARY_DIR: 'C:\local\boost_1_81_0\lib64-msvc-14.3'
BOOST_LIBRARYDIR: 'C:\local\boost_1_81_0\lib64-msvc-14.3'
with:
cmake_target: launchdarkly-cpp-server
platform_version: 2022
toolset: msvc
2 changes: 1 addition & 1 deletion .github/workflows/sse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- '**.md'

jobs:
build-test:
build-test-sse:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
Expand Down
6 changes: 3 additions & 3 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"libs/client-sdk": "3.0.3",
"libs/client-sdk": "3.0.6",
"libs/server-sent-events": "0.1.1",
"libs/common": "0.3.2",
"libs/internal": "0.1.5"
"libs/common": "0.3.4",
"libs/internal": "0.1.7"
}
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ if (BUILD_TESTING)
if (TESTING_SANITIZERS)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fsanitize=undefined -fsanitize=leak")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fsanitize=leak")
endif ()
Expand Down Expand Up @@ -67,7 +69,7 @@ endif ()

set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost 1.80 REQUIRED COMPONENTS json url coroutine)
find_package(Boost 1.81 REQUIRED COMPONENTS json url coroutine)
message(STATUS "LaunchDarkly: using Boost v${Boost_VERSION}")

add_subdirectory(libs/client-sdk)
Expand Down
Loading

0 comments on commit 20abc69

Please sign in to comment.