Skip to content

Add third party license text (#21) #116

Add third party license text (#21)

Add third party license text (#21) #116

Workflow file for this run

name: CMake
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
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: |
cp -R ./THIRD_PARTY_LICENSES.txt ./build/CZICheck/
- name: Package
if: ${{ (matrix.os == 'ubuntu-latest') }}
shell: bash
run: |
mkdir release
name="CZICheck-linux-x64-$(git describe --always)"
mkdir "release/${name}"
cd ./build/CZICheck
cp "CZICheck" "./../../release/${name}/"
cp "THIRD_PARTY_LICENSES.txt" "./../../release/${name}/"
cd ../..
echo "artifactName=${name}" >> "$GITHUB_ENV"
echo "artifactPath=release/${name}" >> "$GITHUB_ENV"
- name: Package
if: ${{ (matrix.os == 'windows-latest') }}
shell: bash
run: |
mkdir release
name="CZICheck-windows-x64-$(git describe --always)"
mkdir "release/${name}"
cp ./build/CZICheck/${{ matrix.build }}/*.exe "release/${name}/"
cp ./build/CZICheck/THIRD_PARTY_LICENSES.txt "release/${name}/"
echo "artifactName=${name}" >> "$GITHUB_ENV"
echo "artifactPath=release/${name}" >> "$GITHUB_ENV"
- name: Upload artifacts
if: matrix.build == 'Release'
uses: actions/upload-artifact@v4
with:
path: ${{ env.artifactPath }}/
name: ${{ env.artifactName }}