-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathaction.yml
More file actions
119 lines (115 loc) · 4.78 KB
/
action.yml
File metadata and controls
119 lines (115 loc) · 4.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# This is a composite to allow sharing these steps into other workflows.
# It isn't a shared workflow, because then it isn't convenient to add
# additional package-specific steps.
# The CMake project should follow a convention where the test project is
# gtest_LIBNAME for instance gtest_launchdarkly-cpp-common.
name: Shared CI Workflow
description: 'Shared CI workflow used by C++ packages.'
inputs:
cmake_target:
description: 'The name of the CMake target. i.e. launchdarkly-cpp-common'
required: true
run_tests:
description: 'Whether gtest targets should be built & run.'
required: false
default: 'true'
platform_version:
description: 'Boost platform version'
required: false
default: "22.04"
toolset:
description: 'Boost toolset'
required: false
simulate_release:
description: 'Whether to run ./build-release.sh for the CMake target'
required: false
default: 'false'
simulate_windows_release:
description: 'Whether to run ./build-release-windows.sh for the CMake target'
required: false
default: 'false'
use_curl:
description: 'Whether to enable CURL networking (LD_CURL_NETWORKING=ON)'
required: false
default: 'false'
install_curl:
description: 'Whether to install CURL development libraries. Required for OpenTelemetry builds (server-sdk-otel), but does not enable CURL networking for the SDK itself.'
required: false
default: 'false'
use_redis:
description: 'Whether to enable Redis support (LD_BUILD_REDIS_SUPPORT=ON). Leave unset to preserve automatic detection for Redis targets.'
required: false
default: ''
runs:
using: composite
steps:
- name: Install Ninja
uses: ./.github/actions/install-ninja
- name: Install boost
uses: ./.github/actions/install-boost
id: install-boost
with:
platform_version: ${{ inputs.platform_version }}
toolset: ${{ inputs.toolset }}
- name: Install OpenSSL
uses: ./.github/actions/install-openssl
id: install-openssl
- name: Install CURL
if: inputs.use_curl == 'true' || inputs.install_curl == 'true'
uses: ./.github/actions/install-curl
id: install-curl
- name: Build Library
shell: bash
run: ./scripts/build.sh ${{ inputs.cmake_target }} ON ${{ inputs.use_curl }} ${{ inputs.use_redis }}
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
Boost_DIR: ${{ steps.install-boost.outputs.Boost_DIR }}
OPENSSL_ROOT_DIR: ${{ steps.install-openssl.outputs.OPENSSL_ROOT_DIR }}
CURL_ROOT: ${{ steps.install-curl.outputs.CURL_ROOT }}
CMAKE_PREFIX_PATH: ${{ steps.install-curl.outputs.CURL_ROOT }}
- name: Build Tests
id: build-tests
if: inputs.run_tests == 'true'
shell: bash
run: ./scripts/build.sh gtest_${{ inputs.cmake_target }} ON ${{ inputs.use_curl }} ${{ inputs.use_redis }}
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
Boost_DIR: ${{ steps.install-boost.outputs.Boost_DIR }}
OPENSSL_ROOT_DIR: ${{ steps.install-openssl.outputs.OPENSSL_ROOT_DIR }}
CURL_ROOT: ${{ steps.install-curl.outputs.CURL_ROOT }}
CMAKE_PREFIX_PATH: ${{ steps.install-curl.outputs.CURL_ROOT }}
- name: Run Tests
if: steps.build-tests.outcome == 'success'
shell: bash
# This uses the binary, versus "make tests" because the binary
# has better performance and output.
run: ./build/gtest_${{ inputs.cmake_target }}
- name: Simulate Release (Linux/MacOS)
if: inputs.simulate_release == 'true'
shell: bash
run: |
if [ "${{ inputs.use_curl }}" == "true" ]; then
./scripts/build-release.sh ${{ inputs.cmake_target }} --with-curl
else
./scripts/build-release.sh ${{ inputs.cmake_target }}
fi
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
OPENSSL_ROOT_DIR: ${{ steps.install-openssl.outputs.OPENSSL_ROOT_DIR }}
CURL_ROOT: ${{ steps.install-curl.outputs.CURL_ROOT }}
CMAKE_PREFIX_PATH: ${{ steps.install-curl.outputs.CURL_ROOT }}
- name: Simulate Release (Windows)
if: inputs.simulate_windows_release == 'true'
shell: bash
run: |
if [ "${{ inputs.use_curl }}" == "true" ]; then
./scripts/build-release-windows.sh ${{ inputs.cmake_target }} --with-curl
else
./scripts/build-release-windows.sh ${{ inputs.cmake_target }}
fi
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
OPENSSL_ROOT_DIR: ${{ steps.install-openssl.outputs.OPENSSL_ROOT_DIR }}
Boost_DIR: 'C:\local\boost_1_87_0\lib64-msvc-14.3\cmake\Boost-1.87.0'
CURL_ROOT: ${{ steps.install-curl.outputs.CURL_ROOT }}
CMAKE_PREFIX_PATH: ${{ steps.install-curl.outputs.CURL_ROOT }}