Add third party license text #83
This file contains hidden or 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 | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
strategy: | |
matrix: | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
build: [Release] | |
os: [ubuntu-latest, windows-latest] | |
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. | |
# You can convert this to a matrix build if you need cross-platform coverage. | |
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install dependencies (Windows) | |
if: ${{ (matrix.OS == 'windows-latest') }} | |
# on Windows, we rely on vcpkg to pull in dependencies | |
shell: bash | |
run: | | |
vcpkg install xerces-c --triplet x64-windows-static | |
- name: Install dependencies (Linux) | |
if: ${{ (matrix.OS == 'ubuntu-latest') }} | |
# on Linux, we use apt to get our dependencies | |
shell: bash | |
run: | | |
sudo apt-get install libxerces-c-dev -y | |
- name: Configure CMake (Windows) | |
if: ${{ (matrix.OS == 'windows-latest') }} | |
shell: bash | |
run: | | |
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. | |
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type | |
# on Windows, we need to point CMake to the vcpkg-toolchain-file | |
cmake -B "${{github.workspace}}/build" -DCMAKE_BUILD_TYPE=${{matrix.build}} \ | |
-DCMAKE_TOOLCHAIN_FILE="${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" \ | |
-DVCPKG_TARGET_TRIPLET=x64-windows-static \ | |
-DCZICHECK_BUILD_TESTS=ON | |
- name: Configure CMake (Linux) | |
if: ${{ (matrix.OS == 'ubuntu-latest') }} | |
shell: bash | |
run: | | |
cmake -B "${{github.workspace}}/build" -DCMAKE_BUILD_TYPE=${{matrix.build}} \ | |
-DCZICHECK_BUILD_TESTS=ON | |
- name: Build | |
# Build your program with the given configuration | |
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build}} | |
- name: CTest | |
# Run tests | |
run: | | |
cd "${{github.workspace}}/build" | |
ctest -C ${{matrix.build}} --verbose | |
- name: Prepare licenses | |
if: matrix.build == 'Release' | |
shell: bash | |
run: | | |
set -e | |
cp -R ./THIRD_PARTY_LICENSES.txt ./build/CZICheck | |
# gather the binaries and put them into a zip-file | |
- name: Package | |
if: ${{ (matrix.OS == 'ubuntu-latest') }} | |
shell: bash | |
run: | | |
mkdir release | |
cd ./build/CZICheck | |
zip -r ./../../CZICheck.zip CZICheck | |
cd ../.. | |
name="CZICheck-linux-x64-$(git describe --always).zip" | |
mv -v ./CZICheck.zip "release/${name}" | |
echo "name=${name}" >> "$GITHUB_OUTPUT" | |
echo "path=release/${name}" >> "$GITHUB_OUTPUT" | |
echo "artifactName=Linux-x64" >> "$GITHUB_ENV" # set the artifactName for the upload step | |
- name: Package | |
if: ${{ (matrix.OS == 'windows-latest') }} | |
shell: bash | |
run: | | |
mkdir release | |
7z a -r CZICheck.zip "./build/CZICheck/${{env.BUILD_TYPE}}/*.exe" | |
name="CZICheck-windows-win64-$(git describe --always).zip" | |
mv -v ./CZICheck.zip "release/${name}" | |
echo "name=${name}" >> "$GITHUB_OUTPUT" | |
echo "path=release/${name}" >> "$GITHUB_OUTPUT" | |
echo "artifactName=Windows-x64" >> "$GITHUB_ENV" # set the artifactName for the upload step |