build: support installation via find_package #4
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
name: cmake-integration | |
on: | |
push: | |
branches: [ main ] | |
paths-ignore: | |
- '**.md' # Do not need to run CI for markdown changes. | |
pull_request: | |
branches: [ "main", "feat/**" ] | |
paths-ignore: | |
- '**.md' | |
schedule: | |
# Run daily at midnight PST | |
- cron: '0 8 * * *' | |
jobs: | |
test-ubuntu: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Ninja | |
uses: ./.github/actions/install-ninja | |
- name: Install boost | |
uses: ./.github/actions/install-boost | |
id: install-boost | |
with: | |
platform_version: '22.04' | |
- name: Install OpenSSL | |
uses: ./.github/actions/install-openssl | |
id: install-openssl | |
- name: Build the SDK | |
env: | |
# These will be injected into the SDK CMake project on the command line, via "-D BOOST_ROOT=..." | |
# and "-D OPENSSL_ROOT_DIR=...". When the integration tests are configured, they will then be passed | |
# along in the same manner to those test projects via the command line. | |
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }} | |
OPENSSL_ROOT_DIR: ${{ steps.install-openssl.outputs.OPENSSL_ROOT_DIR }} | |
shell: bash | |
run: | | |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=../INSTALL .. | |
cmake --build build | |
cmake --install build | |
- name: Package the SDK | |
shell: bash | |
run: | | |
cpack --config build/CPackConfig.cmake | |
- name: Install package | |
run: | | |
sudo dpkg -i launchdarkly-0.1.0.deb || apt-get install -fy | |
- name: Verify installation | |
run: | | |
ls /usr/local/lib && ls /usr/local/include |