CMAKE_PREFIX_PATH? #129
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 and Unit Tests | |
on: [push, pull_request] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
plat: [ubuntu-latest, windows-latest, macos-13] | |
include: | |
- plat: ubuntu-latest | |
triplet: x64-linux | |
csharp: mono | |
toolchain: sudo apt-get update ; sudo apt-get upgrade ; sudo apt-get install -y autoconf-archive libicu-dev doctest-dev lcov | |
cmakeflags: -DCMAKE_BUILD_TYPE=Debug -DWITH_TESTS=ON -DWITH_COVERAGE=ON | |
vcpkg: false | |
- plat: windows-latest | |
triplet: x64-windows | |
csharp: '' | |
toolchain: null | |
cmakeflags: -DCMAKE_BUILD_TYPE=Debug -DWITH_TESTS=ON -DWITH_COVERAGE=OFF | |
vcpkg: true | |
- plat: macos-13 | |
triplet: x64-osx | |
csharp: mono | |
toolchain: brew install --force autoconf-archive doctest icu4c | |
cmakeflags: -G Xcode -DCMAKE_BUILD_TYPE=Debug -DWITH_TESTS=ON -DWITH_COVERAGE=OFF -DCMAKE_PREFIX_PATH='/usr/local/opt/icu4c /usr/local/opt/doctest' | |
vcpkg: false | |
runs-on: ${{ matrix.plat }} | |
continue-on-error: true | |
env: | |
VCPKG_BINARY_SOURCES: clear;nuget,GitHub,readwrite | |
VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }} | |
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 | |
steps: | |
- name: Install required tools/libraries | |
if: matrix.toolchain | |
run: ${{ matrix.toolchain }} | |
continue-on-error: true | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Setup NuGet credentials for vcpkg binary-caching | |
if: matrix.vcpkg | |
shell: bash | |
run: > | |
${{ matrix.csharp }} `vcpkg fetch nuget | tail -n 1` | |
sources add | |
-source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" | |
-storepasswordincleartext | |
-name "GitHub" | |
-username "${{ github.repository_owner }}" | |
-password "${{ secrets.GITHUB_TOKEN }}" | |
- name: Get latest vcpkg port files | |
if: matrix.vcpkg | |
run: git clone --depth 1 'https://github.com/microsoft/vcpkg' | |
- name: Run CMake generator | |
run: cmake . -B build ${{ matrix.cmakeflags }} -DWITH_VCPKG=${{ matrix.vcpkg && 'ON' || 'OFF' }} | |
- name: Build project | |
run: cmake --build build --config Debug | |
- name: Run unit tests | |
run: build/bin/tvm_spec | |
- name: Set up coverage | |
if: env.VCPKG_DEFAULT_TRIPLET == 'x64-linux' | |
run: cd build && make coverage | |
- name: Coveralls | |
if: env.VCPKG_DEFAULT_TRIPLET == 'x64-linux' | |
uses: coverallsapp/github-action@v2.2.3 | |
with: | |
file: build/coverage.info | |
format: lcov |