steps: # Need this for virtualenv - task: UsePythonVersion@0 inputs: versionSpec: '3.8' - bash: | set -e pipefail if [[ "$TILEDB_ARROW_TESTS" == "ON" ]]; then pip install pyarrow pybind11 numpy fi - powershell: | mkdir $env:AGENT_BUILDDIRECTORY\build cd $env:AGENT_BUILDDIRECTORY\build if ($env:imageName -eq "vs2017-win2016") { $env:Path += ";C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin" } else { Write-Host "Unknown image name: '$($env:imageName)'" $host.SetShouldExit(1) } # TODO DEBUG move this back in the TILEDB_S3 section # currently we do not run S3 tests on Windows because tests time out (minio+azure slow?) #& "$env:BUILD_SOURCESDIRECTORY\scripts\install-minio.ps1" if ($env:TILEDB_S3 -eq "ON") { & "$env:BUILD_SOURCESDIRECTORY\bootstrap.ps1" -EnableS3 -EnableVerbose -EnableStaticTileDB -EnableBuildDeps } else { & "$env:BUILD_SOURCESDIRECTORY\bootstrap.ps1" -EnableVerbose -EnableStaticTileDB -EnableBuildDeps } if ($LastExitCode -ne 0) { Write-Host "Bootstrap failed." $host.SetShouldExit($LastExitCode) } cmake --build $env:AGENT_BUILDDIRECTORY\build --config Release -j $env:NUMBER_OF_PROCESSORS -- /verbosity:minimal if ($LastExitCode -ne 0) { Write-Host "Build failed. CMake exit status: " $LastExitCocde $host.SetShouldExit($LastExitCode) } cmake --build $env:AGENT_BUILDDIRECTORY\build -j $env:NUMBER_OF_PROCESSORS --target install-tiledb --config Release if ($LastExitCode -ne 0) { Write-Host "Installation failed." $host.SetShouldExit($LastExitCode) } displayName: "Build" - powershell: | $env:MINIO_ACCESS_KEY = "minio" $env:MINIO_SECRET_KEY = "miniosecretkey" $env:AWS_ACCESS_KEY_ID = "minio" $env:AWS_SECRET_ACCESS_KEY = "miniosecretkey" # Clone backwards compatibility test arrays if ($env:BACKWARDS_COMPATIBILITY_ARRAYS -eq "ON") { git clone https://github.com/TileDB-Inc/TileDB-Unit-Test-Arrays.git --branch 2.2.0 $env:BUILD_SOURCESDIRECTORY/test/inputs/arrays/read_compatibility_test } if ($env:TILEDB_S3 -eq "ON") { # update CMake to disable S3 for the test configuration, see minio note above cmake -B $env:AGENT_BUILDDIRECTORY\build\tiledb -DTILEDB_S3=0 $env:AGENT_BUILDDIRECTORY\build\tiledb } # CMake exits with non-0 status if there are any warnings during the build, so # build the unit test executable before running tests. cmake --build $env:AGENT_BUILDDIRECTORY\build\tiledb -j $env:NUMBER_OF_PROCESSORS --target tiledb_unit --config Release -- /verbosity:minimal # Actually run tests cmake --build $env:AGENT_BUILDDIRECTORY\build\tiledb --target check --config Release -- /verbosity:minimal if ($LastExitCode -ne 0) { Write-Host "Tests failed. CMake exit status: " $LastExitCocde $host.SetShouldExit($LastExitCode) } # Build the examples cmake --build $env:AGENT_BUILDDIRECTORY\build --target examples --config Release -- /verbosity:minimal if ($LastExitCode -ne 0) { Write-Host "Examples failed to build." $host.SetShouldExit($LastExitCode) } $env:Path += ";$env:AGENT_BUILDDIRECTORY\s\dist\bin;$env:AGENT_BUILDDIRECTORY\build\externals\install\bin" ls $env:AGENT_BUILDDIRECTORY\build\tiledb\examples\c_api\Release try { $exepath = Join-Path $env:AGENT_BUILDDIRECTORY "build\tiledb\examples\c_api\Release\quickstart_dense_c.exe" & $exepath } catch { Write-Host "C API example failed. Error:" Write-Host $_ $host.SetShouldExit(1) } try { $exepath = Join-Path $env:AGENT_BUILDDIRECTORY "build\tiledb\examples\cpp_api\Release\quickstart_dense_cpp.exe" & $exepath } catch { Write-Host "C++ API example failed." $host.SetShouldExit(1) } if ($LastExitCode -ne 0) { Write-Host "C++ API example failed." $host.SetShouldExit($LastExitCode) } # Build examples cd $env:AGENT_BUILDDIRECTORY\s\examples\cmake_project mkdir build cd build # Build zip artifact cmake -A X64 -DCMAKE_PREFIX_PATH="$env:AGENT_BUILDDIRECTORY\s\dist" .. cmake --build . --config Release -- /verbosity:minimal .\Release\ExampleExe.exe .\Release\ExampleExe_static.exe #cd $env:AGENT_BUILDDIRECTORY #7z a tiledb-windows-x64.zip $env:AGENT_BUILDDIRECTORY\s\dist displayName: "Test" #- task: ArchiveFiles@2 # inputs: # rootFolderOrFile: '$(Agent.BuildDirectory)\s\dist' # includeRootFolder: false # archiveType: 'zip' # archiveFile: '$(Build.ArtifactStagingDirectory)/tiledb-windows-x64-$(Build.SourceVersion).zip' # replaceExistingArchive: true # verbose: # Optional - powershell: | # tiledb_unit is configured to set a job-level variable TILEDB_CI_SUCCESS=1 # following the test run. If this variable is not set, the build should fail. # see https://github.com/TileDB-Inc/TileDB/pull/1400 (5f0623f4d3) if ($env:TILEDB_CI_SUCCESS -ne 1) { Write-Host "tiledb_unit sanity-check failed! Go check logs." $host.SetShouldExit(1) } displayName: "Test status check" - powershell: | (Get-ChildItem -Path $env:BUILD_SOURCESDIRECTORY -Include *.log -Recurse).fullname | ForEach-Object {echo $_ ---; Get-Content $_; echo ===} condition: failed() # only run this job if the build step failed displayName: "Print log files (failed build only)" - task: PublishBuildArtifacts@1 inputs: #pathtoPublish: '$(Build.ArtifactStagingDirectory)/tiledb-windows-x64-$(Build.SourceVersion).zip' pathtoPublish: '$(Agent.BuildDirectory)\s\dist\' artifactName: 'tiledb-windows-x64-$(Build.SourceVersion)' condition: and(succeeded(), eq(variables['imageName'], 'vs2017-win2016'))