diff --git a/build/ci/job-template.yml b/build/ci/job-template.yml index 8ee9572fe9..e0676173d6 100644 --- a/build/ci/job-template.yml +++ b/build/ci/job-template.yml @@ -41,8 +41,13 @@ jobs: ROOTFS_DIR: '/crossrootfs/${{ parameters.architecture }}' ${{ if eq(parameters.codeCoverage, 'true') }}: hardLink: '' + ${{ if eq(parameters.buildScript, 'build.cmd') }}: + arcadeCiOption: '-ci' + ${{ if eq(parameters.buildScript, './build.sh') }}: + arcadeCiOption: '--ci' ${{ if eq(parameters.codeCoverage, 'false') }}: hardLink: '/p:CreateHardLinksForCopyLocalIfPossible=True' + arcadeCiOption: '' testTargetFramework: '/p:TestTargetFramework=$(_targetFramework)' strategy: matrix: @@ -75,7 +80,7 @@ jobs: - ${{ if and( eq(parameters.nightlyBuild, 'true'), eq(parameters.pool.vmImage, 'ubuntu-18.04')) }}: - bash: echo "##vso[task.setvariable variable=LD_LIBRARY_PATH]$(nightlyBuildRunPath):$LD_LIBRARY_PATH" displayName: Set LD_LIBRARY_PATH for Ubuntu and CentOS to locate Native shared library in current running path - - script: ${{ parameters.buildScript }} -configuration $(_configuration) /p:TargetArchitecture=${{ parameters.architecture }} /p:Coverage=${{ parameters.codeCoverage }} $(testTargetFramework) /p:CreateHardLinksForCopyFilesToOutputDirectoryIfPossible=True $(hardLink) + - script: ${{ parameters.buildScript }} $(arcadeCiOption) -configuration $(_configuration) /p:TargetArchitecture=${{ parameters.architecture }} /p:Coverage=${{ parameters.codeCoverage }} $(testTargetFramework) /p:CreateHardLinksForCopyFilesToOutputDirectoryIfPossible=True $(hardLink) displayName: Build - ${{ if eq(parameters.pool.vmImage, 'macOS-10.15') }}: - task: Bash@3 @@ -120,10 +125,13 @@ jobs: - ${{ if eq(parameters.nightlyBuild, 'false') }}: - ${{ if eq(parameters.innerLoop, 'false') }}: - ${{ if and(eq(parameters.runSpecific, 'false'), eq(parameters.useVSTestTask, 'false')) }}: - - script: set PATH=%PATH%;%USERPROFILE%\.nuget\packages\libtorch-cpu-win-x64\2.2.1.1\runtimes\win-x64\native;%USERPROFILE%\.nuget\packages\torchsharp\0.102.7\runtimes\win-x64\native & ${{ parameters.buildScript }} /p:Build=false -configuration $(_configuration) /p:TargetArchitecture=${{ parameters.architecture }} -test -integrationTest /p:Coverage=${{ parameters.codeCoverage }} $(testTargetFramework) + - script: | + for /f "delims=" %%p in ('$(dotnetPath) msbuild test\run-tests.proj -getProperty:NuGetPackageRoot /p:ContinuousIntegrationBuild^=${{ parameters.codeCoverage }} -nologo') do set "NUGET_PACKAGE_ROOT=%%p" + set "PATH=%PATH%;%NUGET_PACKAGE_ROOT%libtorch-cpu-win-x64\2.2.1.1\runtimes\win-x64\native;%NUGET_PACKAGE_ROOT%torchsharp\0.102.7\runtimes\win-x64\native" + ${{ parameters.buildScript }} $(arcadeCiOption) /p:Build=false -configuration $(_configuration) /p:TargetArchitecture=${{ parameters.architecture }} -test -integrationTest /p:Coverage=${{ parameters.codeCoverage }} $(testTargetFramework) displayName: Run All Tests. - ${{ if and(eq(parameters.runSpecific, 'true'), eq(parameters.useVSTestTask, 'false')) }}: - - script: ${{ parameters.buildScript }} /p:Build=false -configuration $(_configuration) /p:TargetArchitecture=${{ parameters.architecture }} -test -integrationTest /p:TestRunnerAdditionalArguments='-trait$(spaceValue)Category=RunSpecificTest' /p:Coverage=${{ parameters.codeCoverage }} $(testTargetFramework) + - script: ${{ parameters.buildScript }} $(arcadeCiOption) /p:Build=false -configuration $(_configuration) /p:TargetArchitecture=${{ parameters.architecture }} -test -integrationTest /p:TestRunnerAdditionalArguments='-trait$(spaceValue)Category=RunSpecificTest' /p:Coverage=${{ parameters.codeCoverage }} $(testTargetFramework) displayName: Run Specific Tests. - ${{ if and(eq(parameters.buildScript, 'build.cmd'), eq(parameters.useVSTestTask, 'true')) }}: - task: VSTest@2 @@ -148,7 +156,7 @@ jobs: publishRunAttachments: true - ${{ if eq(parameters.innerLoop, 'true') }}: - ${{ if eq(parameters.codeCoverage, True) }}: - - script: ${{ parameters.buildScript }} /p:Build=false -configuration $(_configuration) /p:TargetArchitecture=${{ parameters.architecture }} -test -integrationTest /p:TestRunnerAdditionalArguments='-notrait$(spaceValue)Category=SkipInCI' /p:Coverage=${{ parameters.codeCoverage }} $(testTargetFramework) + - script: ${{ parameters.buildScript }} $(arcadeCiOption) /p:Build=false -configuration $(_configuration) /p:TargetArchitecture=${{ parameters.architecture }} -test -integrationTest /p:TestRunnerAdditionalArguments='-notrait$(spaceValue)Category=SkipInCI' /p:Coverage=${{ parameters.codeCoverage }} $(testTargetFramework) displayName: Run CI Tests. - ${{ if eq(parameters.codeCoverage, False) }}: - template: /build/ci/send-to-helix.yml @@ -157,11 +165,11 @@ jobs: Configuration: $(_configuration) Architecture: ${{ parameters.architecture }} ${{ if eq(parameters.buildScript, 'build.cmd') }}: - MsBuildScript: 'powershell $(Build.SourcesDirectory)/eng/common/msbuild.ps1' + MsBuildScript: 'powershell $(Build.SourcesDirectory)/eng/common/msbuild.ps1 -ci' WarnAsError: '-warnAsError 0' TestTargetFramework: '$(testTargetFramework)' ${{ if eq(parameters.buildScript, './build.sh') }}: - MsBuildScript: '$(Build.SourcesDirectory)/eng/common/msbuild.sh' + MsBuildScript: '$(Build.SourcesDirectory)/eng/common/msbuild.sh --ci' WarnAsError: '--warnAsError false' TestTargetFramework: '$(testTargetFramework)' - script: $(dotnetPath) msbuild -restore build/Codecoverage.proj