Added CUTTLEFISH_STATIC_RUNTIME CMake option. #46
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: Cuttlefish | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
env: | ||
CTEST_OUTPUT_ON_FAILURE: '1' | ||
GTEST_OUTPUT: xml:${{ github.workspace }}/test-results/ | ||
cmake_common_args: >- | ||
-DCUTTLEFISH_FORCE_INTERNAL_FREEIMAGE=ON | ||
-DCMAKE_FIND_ROOT_PATH=${{ github.workspace }}/dependencies | ||
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/dependencies | ||
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/build/cuttlefish | ||
cores_count: '4' | ||
cores_mac_count: '3' | ||
dependency_location: "${{ github.workspace }}/dependencies" | ||
gtest_version: v1.15.2 | ||
ispc_version: 1.25.3 | ||
test_results_location: "${{ github.workspace }}/test-results" | ||
jobs: | ||
Linux: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
include: | ||
- lib_type: Static | ||
cmake_args: "-DCUTTLEFISH_SHARED=OFF" | ||
ispc: 0 | ||
- lib_type: Shared | ||
cmake_args: "-DCUTTLEFISH_SHARED=ON" | ||
ispc: 0 | ||
- lib_type: Static | ||
cmake_args: "-DCUTTLEFISH_SHARED=OFF -DCUTTLEFISH_ISPC_PATH=/tmp/ispc/bin/ispc" | ||
ispc: 1 | ||
- lib_type: Shared | ||
cmake_args: "-DCUTTLEFISH_SHARED=ON -DCUTTLEFISH_ISPC_PATH=/tmp/ispc/bin/ispc" | ||
ispc: 1 | ||
artifact: 1 | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
- name: Download submodules | ||
run: |- | ||
git submodule update --init | ||
sudo apt-get update | ||
sudo apt-get -y install doxygen | ||
if [ ${{ matrix.ispc }} -eq 1 ]; then | ||
curl -L https://github.com/ispc/ispc/releases/download/v${{ env.ispc_version }}/ispc-v${{ env.ispc_version }}-linux.tar.gz -o ispc.tar.gz | ||
tar xzf ispc.tar.gz | ||
mv ispc-v${{ env.ispc_version }}-linux /tmp/ispc | ||
fi | ||
working-directory: "${{ github.workspace }}" | ||
- name: Build gtest | ||
run: |- | ||
git clone https://github.com/google/googletest.git googletest-code | ||
cd googletest-code | ||
git checkout ${{ env.gtest_version }} | ||
mkdir build | ||
cd build | ||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{ env.dependency_location }} | ||
cmake --build . -j ${{ env.cores_count }} | ||
cmake --build . --target install | ||
working-directory: "${{ github.workspace }}" | ||
- name: Build debug | ||
run: |- | ||
mkdir -p build/Debug | ||
cd build/Debug | ||
cmake -DCMAKE_BUILD_TYPE=Debug ${{ env.cmake_common_args }} ${{ matrix.cmake_args }} \ | ||
${{ github.workspace }} | ||
cmake --build . -j ${{ env.cores_count }} | ||
working-directory: "${{ github.workspace }}" | ||
- name: Run tests debug | ||
continue-on-error: true | ||
timeout-minutes: 5 | ||
run: ctest | ||
working-directory: "${{ github.workspace }}/build/Debug" | ||
- name: Publish test results | ||
uses: EnricoMi/publish-unit-test-result-action@v2 | ||
with: | ||
check_name: Tests (Linux ${{ matrix.lib_type }} ISPC:${{ matrix.ispc }} Debug) | ||
junit_files: "${{ env.test_results_location }}/*.xml" | ||
- name: Clear test results | ||
run: rm *.xml | ||
working-directory: "${{ env.test_results_location }}" | ||
- name: Build release | ||
run: |- | ||
mkdir -p build/Release | ||
cd build/Release | ||
cmake -DCMAKE_BUILD_TYPE=Release ${{ env.cmake_common_args }} ${{ matrix.cmake_args }} \ | ||
${{ github.workspace }} | ||
cmake --build . -j ${{ env.cores_count }} | ||
working-directory: "${{ github.workspace }}" | ||
- name: Run tests release | ||
continue-on-error: true | ||
timeout-minutes: 5 | ||
run: ctest | ||
working-directory: "${{ github.workspace }}/build/Release" | ||
- name: Publish test results | ||
uses: EnricoMi/publish-unit-test-result-action@v2 | ||
with: | ||
check_name: Tests (Linux ${{ matrix.lib_type }} ISPC:${{ matrix.ispc }} Release) | ||
junit_files: "${{ env.test_results_location }}/*.xml" | ||
- name: Package artifact | ||
if: matrix.artifact == 1 | ||
run: |- | ||
cmake --build Release --target install | ||
tar czf cuttlefish-linux.tar.gz cuttlefish | ||
working-directory: "${{ github.workspace }}/build" | ||
- name: Publish artifact | ||
if: matrix.artifact == 1 | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Linux | ||
path: "${{ github.workspace }}/build/cuttlefish-linux.tar.gz" | ||
Mac: | ||
runs-on: macos-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- lib_type: Static | ||
cmake_args: >- | ||
-GXcode -DCUTTLEFISH_SHARED=OFF -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" | ||
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 | ||
ispc: 0 | ||
- lib_type: Shared | ||
cmake_args: >- | ||
-GXcode -DCUTTLEFISH_SHARED=ON -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" | ||
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 | ||
ispc: 0 | ||
- lib_type: Static | ||
cmake_args: >- | ||
-GXcode -DCUTTLEFISH_SHARED=OFF -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" | ||
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 -DCUTTLEFISH_ISPC_PATH=/tmp/ispc/bin/ispc | ||
ispc: 1 | ||
- lib_type: Shared | ||
cmake_args: >- | ||
-GXcode -DCUTTLEFISH_SHARED=ON -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" | ||
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 -DCUTTLEFISH_ISPC_PATH=/tmp/ispc/bin/ispc | ||
ispc: 1 | ||
artifact: 1 | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
- name: Download submodules | ||
run: |- | ||
git submodule update --init | ||
brew install doxygen | ||
if [ ${{ matrix.ispc }} -eq 1 ]; then | ||
curl -L https://github.com/ispc/ispc/releases/download/v${{ env.ispc_version }}/ispc-v${{ env.ispc_version }}-macOS.universal.tar.gz -o ispc.tar.gz | ||
tar xzf ispc.tar.gz | ||
mv ispc-v${{ env.ispc_version }}-macOS.universal /tmp/ispc | ||
fi | ||
working-directory: "${{ github.workspace }}" | ||
- name: Build gtest | ||
run: |- | ||
git clone https://github.com/google/googletest.git googletest-code | ||
cd googletest-code | ||
git checkout ${{ env.gtest_version }} | ||
mkdir build | ||
cd build | ||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \ | ||
-DCMAKE_INSTALL_PREFIX=${{ env.dependency_location }} | ||
cmake --build . -j ${{ env.cores_mac_count }} | ||
cmake --build . --target install | ||
working-directory: "${{ github.workspace }}" | ||
- name: Run CMake | ||
run: |- | ||
mkdir build | ||
cd build | ||
cmake ${{ env.cmake_common_args }} ${{ matrix.cmake_args }} ${{ github.workspace }} | ||
working-directory: "${{ github.workspace }}" | ||
- name: Build debug | ||
run: cmake --build . --config Debug | ||
working-directory: "${{ github.workspace }}/build" | ||
- name: Run tests debug | ||
continue-on-error: true | ||
timeout-minutes: 5 | ||
run: ctest -C Debug | ||
working-directory: "${{ github.workspace }}/build" | ||
- name: Publish test results | ||
uses: EnricoMi/publish-unit-test-result-action/macos@v2 | ||
with: | ||
check_name: Tests (Mac ${{ matrix.lib_type }} ISPC:${{ matrix.ispc }} Debug) | ||
junit_files: "${{ env.test_results_location }}/*.xml" | ||
- name: Clear test results | ||
run: rm *.xml | ||
working-directory: "${{ env.test_results_location }}" | ||
- name: Build release | ||
run: cmake --build . --config Release | ||
working-directory: "${{ github.workspace }}/build" | ||
- name: Run tests release | ||
continue-on-error: true | ||
timeout-minutes: 5 | ||
run: ctest -C Release | ||
working-directory: "${{ github.workspace }}/build" | ||
- name: Publish test results | ||
uses: EnricoMi/publish-unit-test-result-action/macos@v2 | ||
with: | ||
check_name: Tests (Mac ${{ matrix.lib_type }} ISPC:${{ matrix.ispc }} Release) | ||
junit_files: "${{ env.test_results_location }}/*.xml" | ||
- name: Fixup install path | ||
run: cmake -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON ${{ github.workspace }} | ||
working-directory: "${{ github.workspace }}/build" | ||
- name: Package artifact | ||
if: matrix.artifact == 1 | ||
run: |- | ||
cmake --build . --config Release --target install | ||
tar czf cuttlefish-mac.tar.gz cuttlefish | ||
working-directory: "${{ github.workspace }}/build" | ||
- name: Publish artifact | ||
if: matrix.artifact == 1 | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Mac | ||
path: "${{ github.workspace }}/build/cuttlefish-mac.tar.gz" | ||
Windows: | ||
runs-on: windows-2019 | ||
strategy: | ||
matrix: | ||
include: | ||
- arch: Win32 | ||
lib_type: Static | ||
cmake_args: "-DCUTTLEFISH_SHARED=OFF" | ||
ispc: 0 | ||
- arch: Win32 | ||
lib_type: Shared | ||
cmake_args: "-DCUTTLEFISH_SHARED=ON" | ||
ispc: 0 | ||
- arch: Win32 | ||
lib_type: Static | ||
cmake_args: "-DCUTTLEFISH_SHARED=OFF -DCUTTLEFISH_STATIC_RUNTIME=ON -DCUTTLEFISH_ISPC_PATH=D:/ispc/bin/ispc.exe" | ||
ispc: 1 | ||
artifact: win32-tool | ||
- arch: Win32 | ||
lib_type: Shared | ||
cmake_args: "-DCUTTLEFISH_SHARED=ON -DCUTTLEFISH_ISPC_PATH=D:/ispc/bin/ispc.exe" | ||
ispc: 1 | ||
artifact: win32-full | ||
- arch: x64 | ||
lib_type: Static | ||
cmake_args: "-DCUTTLEFISH_SHARED=OFF" | ||
ispc: 0 | ||
- arch: x64 | ||
lib_type: Shared | ||
cmake_args: "-DCUTTLEFISH_SHARED=ON" | ||
ispc: 0 | ||
- arch: x64 | ||
lib_type: Static | ||
cmake_args: "-DCUTTLEFISH_SHARED=OFF -DCUTTLEFISH_STATIC_RUNTIME=ON -DCUTTLEFISH_ISPC_PATH=D:/ispc/bin/ispc.exe" | ||
ispc: 1 | ||
artifact: win64-tool | ||
- arch: x64 | ||
lib_type: Shared | ||
cmake_args: "-DCUTTLEFISH_SHARED=ON -DCUTTLEFISH_ISPC_PATH=D:/ispc/bin/ispc.exe" | ||
ispc: 1 | ||
artifact: win64-full | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
- name: Download submodules | ||
run: |- | ||
git submodule update --init | ||
if [ ${{ matrix.ispc }} -eq 1 ]; then | ||
curl -L https://github.com/ispc/ispc/releases/download/v${{ env.ispc_version }}/ispc-v${{ env.ispc_version }}-windows.zip -o ispc.zip | ||
unzip ispc.zip | ||
mv ispc-v${{ env.ispc_version }}-windows /d/ispc | ||
fi | ||
shell: bash | ||
working-directory: "${{ github.workspace }}" | ||
- name: Checkout gtest | ||
run: |- | ||
git clone https://github.com/google/googletest.git googletest-code | ||
cd googletest-code | ||
git checkout ${{ env.gtest_version }} | ||
mkdir build | ||
shell: bash | ||
working-directory: "${{ github.workspace }}" | ||
- name: Build gtest | ||
run: |- | ||
cmake .. -DCMAKE_INSTALL_PREFIX=${{ env.dependency_location }} -Dgtest_force_shared_crt=ON ` | ||
-A ${{ matrix.arch }} -T v141 -DCMAKE_DEBUG_POSTFIX=d | ||
cmake --build . --config Debug | ||
cmake --build . --config Debug --target install | ||
cmake --build . --config Release | ||
cmake --build . --config Release --target install | ||
working-directory: "${{ github.workspace }}/googletest-code/build" | ||
- name: Run CMake | ||
run: |- | ||
mkdir build | ||
cd build | ||
cmake ${{ env.cmake_common_args }} ${{ matrix.cmake_args }} -A ${{ matrix.arch }} -T v141 ` | ||
${{ github.workspace }} | ||
working-directory: "${{ github.workspace }}" | ||
- name: Build debug | ||
run: cmake --build . --config Debug | ||
working-directory: "${{ github.workspace }}/build" | ||
- name: Run tests debug | ||
continue-on-error: true | ||
timeout-minutes: 5 | ||
run: ctest -C Debug | ||
working-directory: "${{ github.workspace }}/build" | ||
- name: Publish test results | ||
uses: EnricoMi/publish-unit-test-result-action/windows@v2 | ||
with: | ||
check_name: >- | ||
Tests (Windows ${{ matrix.arch }} ${{ matrix.lib_type }} ISPC:${{ matrix.ispc }} Debug) | ||
junit_files: "${{ env.test_results_location }}/*.xml" | ||
- name: Clear test results | ||
run: rm *.xml | ||
shell: bash | ||
working-directory: "${{ env.test_results_location }}" | ||
- name: Build release | ||
run: cmake --build . --config Release | ||
working-directory: "${{ github.workspace }}/build" | ||
- name: Run tests release | ||
continue-on-error: true | ||
timeout-minutes: 5 | ||
run: ctest -C Release | ||
working-directory: "${{ github.workspace }}/build" | ||
- name: Publish test results | ||
uses: EnricoMi/publish-unit-test-result-action/windows@v2 | ||
with: | ||
check_name: >- | ||
Tests (Windows ${{ matrix.arch }} ${{ matrix.lib_type }} ISPC:${{ matrix.ispc }} Release) | ||
junit_files: "${{ env.test_results_location }}/*.xml" | ||
- name: Package artifact | ||
if: matrix.artifact != '' && endsWith(matrix.artifact, "-full") | ||
Check failure on line 330 in .github/workflows/main.yml GitHub Actions / CuttlefishInvalid workflow file
|
||
# Full package with debug and release, minus debug .exe. | ||
run: |- | ||
cmake --build . --config Debug --target install | ||
cmake --build . --config Release --target install | ||
rm cuttlefish\\bin\\cuttlefishd.exe | ||
7z a -tzip cuttlefish-${{ matrix.artifact }}.zip cuttlefish | ||
working-directory: "${{ github.workspace }}/build" | ||
- name: Package artifact | ||
if: matrix.artifact != '' && endsWith(matrix.artifact, "-tool") | ||
# Only tool and supplemental DLLs. | ||
run: |- | ||
cmake --build . --config Release --target install | ||
mv cuttlefish\\bin\\* cuttlfish | ||
rm -r cuttlefish/bin cuttlefish\\lib cuttlefish\\include | ||
7z a -tzip cuttlefish-${{ matrix.artifact }}.zip cuttlefish | ||
working-directory: "${{ github.workspace }}/build" | ||
- name: Publish artifact | ||
if: matrix.artifact != '' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: "${{ matrix.artifact }}" | ||
path: "${{ github.workspace }}/build/cuttlefish-${{ matrix.artifact }}.zip" | ||
# vim: ts=2 sts=2 sw=2 et |