Build checking #297
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: Build checking | |
on: | |
# workflow_dispatch - manual start build from action menu | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- '.github/workflows/clean_workflow.yml' | |
- '.github/workflows/codeql-analysis.yml' | |
- '.github/workflows/docker_build.yml' | |
- '.github/workflows/prebuild.yml' | |
- '.github/workflows/release.yml' | |
- 'ci/**' | |
- 'docs/**' | |
- '.clang-format' | |
- '.gitignore' | |
- 'CHANGELOG.md' | |
- 'CMakePresets.json' | |
- 'CONTRIBUTORS' | |
- 'LICENSE' | |
- 'README.md' | |
pull_request: | |
branches: | |
- master | |
env: | |
BUILD_TYPE: Release | |
X_VCPKG_NUGET_ID_PREFIX: 'colorer' | |
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite' | |
jobs: | |
ubuntu-old-gcc: | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [ x64 ] | |
icu: [OFF] | |
zip: [OFF] | |
name: linux-gcc7-${{ matrix.arch }}-icu_${{ matrix.icu }}-zip_${{ matrix.zip }} | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- name: Install dependency | |
run: sudo apt-get -y install ninja-build libicu-dev zlib1g-dev libminizip-dev libxml2-dev | |
- name: Install compiler | |
run: sudo apt-get -y install g++-7 | |
- name: Create Build folder | |
run: mkdir -p _build | |
- name: Get number of CPU cores | |
uses: SimenB/github-actions-cpu-cores@v2 | |
id: cpu-cores | |
- name: Configure CMake | |
run: > | |
cmake -S . -B _build -G "Ninja" | |
-DCMAKE_BUILD_TYPE=$BUILD_TYPE | |
-DCOLORER_BUILD_TEST=ON | |
-DCOLORER_USE_VCPKG=OFF | |
-DCOLORER_BUILD_ARCH=${{ matrix.arch }} | |
-DCOLORER_USE_ICU_STRINGS=${{ matrix.icu }} | |
-DCOLORER_USE_ZIPINPUTSOURCE=${{ matrix.zip }} | |
-DCOLORER_BUILD_OLD_COMPILERS=ON | |
-DCMAKE_CXX_COMPILER=/usr/bin/g++-7 | |
- name: Build | |
run: cmake --build _build --config $BUILD_TYPE -j ${{ steps.cpu-cores.outputs.count }} | |
- name: Test | |
working-directory: ./tests/unit | |
run: ../../_build/tests/unit/unit_tests | |
ubuntu-gcc: | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [ x64 ] | |
icu: [ON, OFF] | |
zip: [ON, OFF] | |
name: linux-${{ matrix.arch }}-icu_${{ matrix.icu }}-zip_${{ matrix.zip }} | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- name: Install dependency | |
run: sudo apt-get -y install ninja-build libicu-dev zlib1g-dev libminizip-dev libxml2-dev | |
- name: Create Build folder | |
run: mkdir -p _build | |
- name: Get number of CPU cores | |
uses: SimenB/github-actions-cpu-cores@v2 | |
id: cpu-cores | |
- name: Configure CMake | |
run: > | |
cmake -S . -B _build -G "Ninja" | |
-DCMAKE_BUILD_TYPE=$BUILD_TYPE | |
-DCOLORER_BUILD_TEST=ON | |
-DCOLORER_USE_VCPKG=OFF | |
-DCOLORER_BUILD_ARCH=${{ matrix.arch }} | |
-DCOLORER_USE_ICU_STRINGS=${{ matrix.icu }} | |
-DCOLORER_USE_ZIPINPUTSOURCE=${{ matrix.zip }} | |
- name: Build | |
run: cmake --build _build --config $BUILD_TYPE -j ${{ steps.cpu-cores.outputs.count }} | |
- name: Test | |
working-directory: ./tests/unit | |
run: ../../_build/tests/unit/unit_tests | |
windows-vc: | |
runs-on: windows-2022 | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [ x64, x86 ] | |
icu: [ON, OFF] | |
zip: [ON, OFF] | |
include: | |
- arch: x64 | |
triplet: x64-windows-static-rel | |
- arch: x86 | |
triplet: x86-windows-static-rel | |
exclude: | |
- arch: x86 | |
zip: OFF | |
name: windows-${{ matrix.arch }}-icu_${{ matrix.icu }}-zip_${{ matrix.zip }} | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
# fetch all for vcpkg versions functionality | |
fetch-depth: 0 | |
- name: Install vcpkg | |
run: | | |
cd external\vcpkg | |
.\bootstrap-vcpkg.bat | |
- name: Add C++ build tools to PATH | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: ${{ matrix.arch }} | |
- name: Setup NuGet Credentials for vpckg cache | |
shell: bash | |
run: > | |
`$GITHUB_WORKSPACE/external/vcpkg/vcpkg fetch nuget | tail -n 1` | |
sources add | |
-source "https://nuget.pkg.github.com/colorer/index.json" | |
-storepasswordincleartext | |
-name "GitHub" | |
-username "${{ secrets.PACKAGES_GITHUB_USER }}" | |
-password "${{ secrets.PACKAGES_GITHUB_TOKEN }}" | |
- name: Create Build folder | |
run: mkdir -p _build | |
- name: Get number of CPU cores | |
uses: SimenB/github-actions-cpu-cores@v2 | |
id: cpu-cores | |
- name: Configure CMake | |
shell: bash | |
# add -DVCPKG_INSTALL_OPTIONS="--debug" for debug output | |
run: > | |
cmake -S . -B _build -G "Ninja" | |
-DCMAKE_BUILD_TYPE=$BUILD_TYPE | |
-DCOLORER_BUILD_TEST=ON | |
-DCOLORER_BUILD_ARCH=${{ matrix.arch }} | |
-DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/external/vcpkg/scripts/buildsystems/vcpkg.cmake | |
-DVCPKG_OVERLAY_PORTS=$GITHUB_WORKSPACE/external/vcpkg-ports | |
-DVCPKG_OVERLAY_TRIPLETS=$GITHUB_WORKSPACE/external/vcpkg-triplets | |
-DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} | |
-DVCPKG_FEATURE_FLAGS=manifests,versions | |
-DCOLORER_USE_ICU_STRINGS=${{ matrix.icu }} | |
-DCOLORER_USE_ZIPINPUTSOURCE=${{ matrix.zip }} | |
- name: Build | |
shell: bash | |
run: cmake --build _build --config $BUILD_TYPE -j ${{ steps.cpu-cores.outputs.count }} | |
- name: Test | |
shell: bash | |
working-directory: ./tests/unit | |
run: ../../_build/tests/unit/unit_tests.exe | |
macos-clang: | |
runs-on: macos-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [ x64 ] | |
icu: [ON, OFF] | |
zip: [ON, OFF] | |
name: macos-${{ matrix.arch }}-icu_${{ matrix.icu }}-zip_${{ matrix.zip }} | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- name: Install dependency | |
# icu4c is already installed | |
run: brew install minizip ninja libxml2 icu4c | |
- name: Relink icu, because he is 'keg-only' | |
run: brew link icu4c --force | |
- name: Create Build folder | |
run: mkdir -p _build | |
- name: Configure CMake | |
run: > | |
cmake -S . -B _build -G "Ninja" | |
-DCMAKE_BUILD_TYPE=$BUILD_TYPE | |
-DCOLORER_BUILD_TEST=ON | |
-DCOLORER_USE_VCPKG=OFF | |
-DCOLORER_BUILD_ARCH=${{ matrix.arch }} | |
-DCOLORER_USE_ICU_STRINGS=${{ matrix.icu }} | |
-DCOLORER_USE_ZIPINPUTSOURCE=${{ matrix.zip }} | |
- name: Build | |
run: cmake --build _build --config $BUILD_TYPE -j$(getconf _NPROCESSORS_ONLN) | |
- name: Test | |
working-directory: ./tests/unit | |
run: ../../_build/tests/unit/unit_tests |