Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Dev/more ci updates #639

Merged
merged 16 commits into from
Jun 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Submodules/ARCore
2 changes: 1 addition & 1 deletion Submodules/Etee
Submodule Etee updated from 569c30 to c34e11
2 changes: 1 addition & 1 deletion Submodules/Lumin
Submodule Lumin updated from c24212 to 560a96
2 changes: 1 addition & 1 deletion Submodules/Oculus
2 changes: 1 addition & 1 deletion Submodules/SDK
Submodule SDK updated from ef7a8e to 16e366
2 changes: 1 addition & 1 deletion Submodules/SteamVR
2 changes: 1 addition & 1 deletion Submodules/Ultraleap
2 changes: 1 addition & 1 deletion Submodules/WindowsMixedReality
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Copyright (c) XRTK. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using System.Linq;
using UnityEditor;
using UnityEngine;

namespace XRTK.Editor.Utilities
{
[InitializeOnLoad]
public static class DevOpsLoggingUtility
{
public static bool LoggingEnabled { get; set; } = Application.isBatchMode;

private static readonly string[] IgnoredLogs =
{
"Using symlinks in Unity projects may cause your project to become corrupted",
};

static DevOpsLoggingUtility()
{
if (LoggingEnabled)
{
Application.logMessageReceived += OnLogMessageReceived;
}
}

private static void OnLogMessageReceived(string condition, string stacktrace, LogType type)
{
if (!LoggingEnabled ||
IgnoredLogs.Any(condition.Contains))
{
return;
}

switch (type)
{
case LogType.Error:
case LogType.Assert:
case LogType.Exception:
Debug.Log($"##vso[task.logissue type=error;]{condition}\n{stacktrace}");
break;
case LogType.Warning:
Debug.Log($"##vso[task.logissue type=warning;]{condition}\n{stacktrace}");
break;
}
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using UnityEditor.SceneManagement;
using UnityEngine;
using UnityEngine.TestTools;
using XRTK.Editor.Utilities;
using XRTK.Interfaces;
using XRTK.Services;
using XRTK.Tests.Services;
Expand All @@ -19,6 +20,9 @@ public class TestFixture_01_MixedRealityToolkitTests
[Test]
public void Test_01_InitializeMixedRealityToolkit()
{
// Disable throwing error/warning logs in the CI/CD pipeline.
DevOpsLoggingUtility.LoggingEnabled = false;

EditorSceneManager.NewScene(NewSceneSetup.EmptyScene, NewSceneMode.Single);
MixedRealityToolkit.ConfirmInitialized();

Expand Down
11 changes: 7 additions & 4 deletions azure_pipelines/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ parameters:
- name: os
type: object
default:
# TODO: Only use XRTK defined platforms for build and install the correct modules and switch to the correct targets as needed
windows:
image: windows-latest
# TODO: Only use XRTK defined platforms for build and install the correct modules and switch to the correct targets as needed
# Unity Hub Modules for Windows Editor: android, ios, appletv linux, mac-mono universal-windows-platform, vuforia-ar, webgl, windows-il2cpp, facebook-games, lumin, android-sdk-ndk-tools
modules: '"windows-il2cpp", "universal-windows-platform", "android"'
targets:
Expand All @@ -16,13 +16,16 @@ parameters:
- Android
macOS:
image: macOS-latest
# Unity Hub Modules for MacOS Editor: android, ios, appletv linux, mac-mono universal-windows-platform, vuforia-ar, webgl, windows-il2cpp, facebook-games, lumin, android-sdk-ndk-tools
modules: '"Mac", "Mac_IL2CPP"'
# Unity Hub Modules for MacOS Editor: android, ios, appletv, linux, mac-il2cpp, vuforia-ar, webgl, windows-mono, facebook-games, lumin, android-sdk-ndk-tools
modules: '"mac-il2cpp", "ios", "android"'
targets:
- StandaloneOSX
- iOS
- Android
linux:
image: ubuntu-latest
modules: '"Linux"'
# Unity Hub Modules for MacOS Editor: linux
modules: '"linux"'
targets:
- StandaloneLinux64

Expand Down
1 change: 0 additions & 1 deletion azure_pipelines/stages/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ stages:
- stage:
displayName: 'publish'
condition: and(succeeded(), or( eq(variables['isReleaseBuild'], 'True'), eq(variables['isPreviewBuild'], 'True') ) )
dependsOn: Build
pool:
name: 'Azure Pipelines'
vmImage: 'windows-latest'
Expand Down
3 changes: 2 additions & 1 deletion azure_pipelines/stages/steps/install-unity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ steps:
$UnityVersion = $matches[1].Groups['version'].Value.Trim()
$UnityVersionChangeSet = $matches[2].Groups['revision'].Value.Trim()

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$wc = New-Object System.Net.WebClient

Write-Host "$(Get-Date): Download Complete, Starting installation..."
Expand All @@ -28,7 +29,7 @@ steps:
# Run Installer
$process = Start-Process @startProcessArgs

if ( $process.ExitCode -ne 0) {
if ( $process.ExitCode -ne 0 ) {
Write-Error "$(Get-Date): Failed with exit code: $($process.ExitCode)"
exit 1
}
Expand Down
10 changes: 9 additions & 1 deletion azure_pipelines/stages/steps/upm-package-info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,21 @@ steps:

Write-Host "Determining latest release version from GitHub..."
$releases = "https://api.github.com/repos/$(Build.Repository.Name)/releases"
$secpasswd = ConvertTo-SecureString $(GitHubPat) -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential("XRTK-Build-Bot", $secpasswd)

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$oldVersionString = [string](Invoke-WebRequest -Uri $releases -UseBasicParsing | ConvertFrom-Json)[0].tag_name
$oldVersionString = [string](Invoke-WebRequest -Uri $releases -Credential $credential -UseBasicParsing | ConvertFrom-Json)[0].tag_name

Write-Host "Detected last GitHub release: $oldVersionString"

# Strip SemVer since version type is not compatible. We do a hard replace on the preview tag anyway.
$version = [version] ($packageInfo.version -replace "-preview.\d*", "")

if( [string]::IsNullOrEmpty($oldVersionString) ) {
$oldVersionString = $packageInfo.version
}

$oldVersion = [version] ($oldVersionString -replace "-preview.\d*", "")

if( '$(isPreviewBuild)' -eq 'True' ) {
Expand Down
3 changes: 2 additions & 1 deletion azure_pipelines/stages/unity-build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
stages:
- stage: Build
- stage:
displayName: ${{ format('{0} build agent', parameters.platform) }}

jobs:
Expand Down Expand Up @@ -54,5 +54,6 @@ stages:
targetPath: '$(System.DefaultWorkingDirectory)\$(project.name)\Builds'
artifact: ${{ format('{0}.{1}.{2}', '$(Build.BuildNumber)', '$(Build.BuildId)', '$(System.JobAttempt)') }}
condition: always()
continueOnError: true

- template: steps/return-unity-license.yml