-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds GitHub workflow for building and testing.
- Loading branch information
1 parent
5890c0e
commit 79390e9
Showing
6 changed files
with
136 additions
and
4 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,76 @@ | ||
# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform. | ||
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml | ||
name: CMake on multiple platforms | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest] | ||
build_type: [Release] | ||
include: | ||
- os: windows-latest | ||
c_compiler: cl | ||
cpp_compiler: cl | ||
cmake_preset: windows | ||
- os: ubuntu-latest | ||
c_compiler: gcc | ||
cpp_compiler: g++ | ||
cmake_preset: unix | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set reusable strings | ||
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. | ||
id: strings | ||
shell: bash | ||
run: | | ||
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" | ||
- name: "Set environmental variables" | ||
shell: bash | ||
run: | | ||
echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV | ||
- name: Install dependencies on Ubuntu | ||
if: matrix.os == 'ubuntu-latest' | ||
run: sudo apt-get install -y libldap2-dev | ||
|
||
- name: Configure CMake | ||
run: cmake -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} --preset=${{ matrix.cmake_preset }} | ||
|
||
- name: Build | ||
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} | ||
|
||
- name: Tests on Windows | ||
if: matrix.os == 'windows-latest' | ||
working-directory: ${{ steps.strings.outputs.build-output-dir }} | ||
run: .\${{ matrix.build_type }}\tests.exe | ||
|
||
- name: Tests on Unix | ||
if: matrix.os == 'ubuntu-latest' | ||
working-directory: ${{ steps.strings.outputs.build-output-dir }} | ||
run: ./tests | ||
|
||
- name: Upload Windows artifacts | ||
if: matrix.os == 'windows-latest' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: EgilSCIMClient-${{ matrix.os }} | ||
path: build/${{ matrix.build_type }} | ||
|
||
- name: Upload Ubuntu artifacts | ||
if: matrix.os == 'ubuntu-latest' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: EgilSCIMClient-${{ matrix.os }} | ||
path: build/EgilSCIMClient |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"version": 2, | ||
"configurePresets": [ | ||
{ | ||
"name": "windows", | ||
"generator": "Visual Studio 17 2022", | ||
"binaryDir": "${sourceDir}/build", | ||
"cacheVariables": { | ||
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" | ||
} | ||
}, | ||
{ | ||
"name": "unix", | ||
"generator": "Unix Makefiles", | ||
"binaryDir": "${sourceDir}/build", | ||
"cacheVariables": { | ||
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", | ||
"CMAKE_BUILD_TYPE": "RelWithDebInfo" | ||
} | ||
}, | ||
{ | ||
"name": "unix_debug", | ||
"generator": "Unix Makefiles", | ||
"binaryDir": "${sourceDir}/build", | ||
"cacheVariables": { | ||
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", | ||
"CMAKE_BUILD_TYPE": "Debug" | ||
} | ||
} | ||
] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"default-registry": { | ||
"kind": "git", | ||
"baseline": "6f1ddd6b6878e7e66fcc35c65ba1d8feec2e01f8", | ||
"repository": "https://github.com/microsoft/vcpkg" | ||
}, | ||
"registries": [ | ||
{ | ||
"kind": "artifact", | ||
"location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip", | ||
"name": "microsoft" | ||
} | ||
] | ||
} |
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,8 @@ | ||
{ | ||
"dependencies": [ | ||
"boost-program-options", | ||
"boost-property-tree", | ||
"boost-uuid", | ||
"curl" | ||
] | ||
} |