diff --git a/kokoro/linux-clang-debug/continuous.cfg b/kokoro/linux-clang-debug/continuous.cfg index e92f059ed..3350f3bb1 100644 --- a/kokoro/linux-clang-debug/continuous.cfg +++ b/kokoro/linux-clang-debug/continuous.cfg @@ -14,3 +14,9 @@ # Continuous build configuration. build_file: "SPIRV-Tools/kokoro/linux-clang-debug/build.sh" + +action { + define_artifacts { + regex: "install.tgz" + } +} diff --git a/kokoro/linux-clang-release/continuous.cfg b/kokoro/linux-clang-release/continuous.cfg index 687434acc..8b075c6eb 100644 --- a/kokoro/linux-clang-release/continuous.cfg +++ b/kokoro/linux-clang-release/continuous.cfg @@ -14,3 +14,9 @@ # Continuous build configuration. build_file: "SPIRV-Tools/kokoro/linux-clang-release/build.sh" + +action { + define_artifacts { + regex: "install.tgz" + } +} diff --git a/kokoro/linux-gcc-debug/continuous.cfg b/kokoro/linux-gcc-debug/continuous.cfg index 4f8418d84..d9579d5a0 100644 --- a/kokoro/linux-gcc-debug/continuous.cfg +++ b/kokoro/linux-gcc-debug/continuous.cfg @@ -14,3 +14,9 @@ # Continuous build configuration. build_file: "SPIRV-Tools/kokoro/linux-gcc-debug/build.sh" + +action { + define_artifacts { + regex: "install.tgz" + } +} diff --git a/kokoro/linux-gcc-release/continuous.cfg b/kokoro/linux-gcc-release/continuous.cfg index 41a0024e7..ead07bf40 100644 --- a/kokoro/linux-gcc-release/continuous.cfg +++ b/kokoro/linux-gcc-release/continuous.cfg @@ -14,3 +14,9 @@ # Continuous build configuration. build_file: "SPIRV-Tools/kokoro/linux-gcc-release/build.sh" + +action { + define_artifacts { + regex: "install.tgz" + } +} diff --git a/kokoro/macos-clang-debug/continuous.cfg b/kokoro/macos-clang-debug/continuous.cfg index 84aaa5c25..f5f274a0e 100644 --- a/kokoro/macos-clang-debug/continuous.cfg +++ b/kokoro/macos-clang-debug/continuous.cfg @@ -14,3 +14,9 @@ # Continuous build configuration. build_file: "SPIRV-Tools/kokoro/macos-clang-debug/build.sh" + +action { + define_artifacts { + regex: "install.tgz" + } +} diff --git a/kokoro/macos-clang-release/continuous.cfg b/kokoro/macos-clang-release/continuous.cfg index a8e23a71a..710185e46 100644 --- a/kokoro/macos-clang-release/continuous.cfg +++ b/kokoro/macos-clang-release/continuous.cfg @@ -14,3 +14,9 @@ # Continuous build configuration. build_file: "SPIRV-Tools/kokoro/macos-clang-release/build.sh" + +action { + define_artifacts { + regex: "install.tgz" + } +} diff --git a/kokoro/scripts/linux/build.sh b/kokoro/scripts/linux/build.sh index 3d20b3864..e89d2eae8 100644 --- a/kokoro/scripts/linux/build.sh +++ b/kokoro/scripts/linux/build.sh @@ -77,7 +77,7 @@ mkdir build && cd $SRC/build # Invoke the build. BUILD_SHA=${KOKORO_GITHUB_COMMIT:-$KOKORO_GITHUB_PULL_REQUEST_COMMIT} echo $(date): Starting build... -cmake -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 -GNinja -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=install -DRE2_BUILD_TESTING=OFF $ADDITIONAL_CMAKE_FLAGS $CMAKE_C_CXX_COMPILER .. +cmake -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 -GNinja -DCMAKE_INSTALL_PREFIX=$KOKORO_ARTIFACTS_DIR/install -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DRE2_BUILD_TESTING=OFF $ADDITIONAL_CMAKE_FLAGS $CMAKE_C_CXX_COMPILER .. echo $(date): Build everything... ninja @@ -97,3 +97,7 @@ then fi echo $(date): ctest completed. +# Package the build. +ninja install +cd $KOKORO_ARTIFACTS_DIR +tar czf install.tgz install diff --git a/kokoro/scripts/macos/build.sh b/kokoro/scripts/macos/build.sh index 8e6d298f9..98e636681 100644 --- a/kokoro/scripts/macos/build.sh +++ b/kokoro/scripts/macos/build.sh @@ -44,6 +44,7 @@ echo $(date): Starting build... # We need Python 3. At the moment python3.7 is the newest Python on Kokoro. cmake \ -GNinja \ + -DCMAKE_INSTALL_PREFIX=$KOKORO_ARTIFACTS_DIR/install \ -DPYTHON_EXECUTABLE:FILEPATH=/usr/local/bin/python3.7 \ -DCMAKE_C_COMPILER=clang \ -DCMAKE_CXX_COMPILER=clang++ \ @@ -58,3 +59,8 @@ echo $(date): Starting ctest... ctest -j4 --output-on-failure --timeout 300 echo $(date): ctest completed. +# Package the build. +ninja install +cd $KOKORO_ARTIFACTS_DIR +tar czf install.tgz install + diff --git a/kokoro/scripts/windows/build.bat b/kokoro/scripts/windows/build.bat index 715dd6aca..0532118f1 100644 --- a/kokoro/scripts/windows/build.bat +++ b/kokoro/scripts/windows/build.bat @@ -58,7 +58,7 @@ if "%KOKORO_GITHUB_COMMIT%." == "." ( set BUILD_SHA=%KOKORO_GITHUB_COMMIT% ) -set CMAKE_FLAGS=-GNinja -DSPIRV_BUILD_COMPRESSION=ON -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DCMAKE_INSTALL_PREFIX=install -DRE2_BUILD_TESTING=OFF -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe +set CMAKE_FLAGS=-DCMAKE_INSTALL_PREFIX=%KOKORO_ARTIFACTS_DIR%\install -GNinja -DSPIRV_BUILD_COMPRESSION=ON -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DRE2_BUILD_TESTING=OFF -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe :: Skip building tests for VS2013 if %VS_VERSION% == 2013 ( @@ -87,6 +87,13 @@ if %VS_VERSION% NEQ 2013 ( ) echo "Tests Completed %DATE% %TIME%" +:: ################################################ +:: Install and package. +:: ################################################ +ninja install +cd %KOKORO_ARTIFACTS_DIR% +zip -r install.zip install + :: Clean up some directories. rm -rf %SRC%\build rm -rf %SRC%\external diff --git a/kokoro/windows-msvc-2017-debug/continuous.cfg b/kokoro/windows-msvc-2017-debug/continuous.cfg index b842c30f1..25c5e113d 100644 --- a/kokoro/windows-msvc-2017-debug/continuous.cfg +++ b/kokoro/windows-msvc-2017-debug/continuous.cfg @@ -14,3 +14,9 @@ # Continuous build configuration. build_file: "SPIRV-Tools/kokoro/windows-msvc-2017-debug/build.bat" + +action { + define_artifacts { + regex: "install.zip" + } +} diff --git a/kokoro/windows-msvc-2017-release/continuous.cfg b/kokoro/windows-msvc-2017-release/continuous.cfg index 7b8c2ff2b..a9ac6eca9 100644 --- a/kokoro/windows-msvc-2017-release/continuous.cfg +++ b/kokoro/windows-msvc-2017-release/continuous.cfg @@ -14,3 +14,9 @@ # Continuous build configuration. build_file: "SPIRV-Tools/kokoro/windows-msvc-2017-release/build.bat" + +action { + define_artifacts { + regex: "install.zip" + } +}