|
11 | 11 | # Global variables |
12 | 12 | variables: |
13 | 13 | DotNetCoreVersion: 3.1.100 |
14 | | - HostedMac: Hosted Mac Internal |
15 | | - HostedWinVS2019: Hosted Windows 2019 with VS2019 |
16 | 14 |
|
17 | 15 | jobs: |
18 | | -- job: windows |
19 | | - displayName: windows |
20 | | - pool: $(HostedWinVS2019) |
| 16 | +- job: build |
| 17 | + displayName: Build and Test |
| 18 | + timeoutInMinutes: 60 |
| 19 | + cancelTimeoutInMinutes: 2 |
| 20 | + |
| 21 | + strategy: |
| 22 | + matrix: |
| 23 | + macOS: |
| 24 | + vmImage: macOS-10.15 |
| 25 | + win2019: |
| 26 | + vmImage: windows-2019 |
| 27 | + |
| 28 | + pool: |
| 29 | + vmImage: $(vmImage) |
| 30 | + |
| 31 | + workspace: |
| 32 | + clean: all |
| 33 | + |
21 | 34 | steps: |
| 35 | + - checkout: self |
| 36 | + clean: true |
| 37 | + |
22 | 38 | - task: UseDotNet@2 |
23 | 39 | displayName: Use .NET Core $(DotNetCoreVersion) |
24 | 40 | inputs: |
25 | 41 | version: $(DotNetCoreVersion) |
| 42 | + |
26 | 43 | - task: NuGetToolInstaller@0 |
27 | 44 | displayName: 'Install NuGet' |
28 | 45 | inputs: |
29 | 46 | versionSpec: 5.x |
| 47 | + |
| 48 | + - script: | |
| 49 | + dotnet tool install --global boots |
| 50 | + boots https://download.mono-project.com/archive/6.12.0/macos-10-universal/MonoFramework-MDK-6.12.0.107.macos10.xamarin.universal.pkg |
| 51 | + displayName: Install Mono 6.12 |
| 52 | + condition: and(succeeded(), eq(variables['agent.os'], 'Darwin')) |
| 53 | +
|
30 | 54 | - task: NuGetCommand@2 |
31 | 55 | displayName: 'NuGet Restore' |
32 | 56 | inputs: |
33 | 57 | restoreSolution: Xamarin.Android.Tools.sln |
34 | 58 | feedsToUse: config |
35 | 59 | nugetConfigPath: NuGet.config |
| 60 | + |
36 | 61 | - task: MSBuild@1 |
37 | 62 | displayName: 'Build solution Xamarin.Android.Tools.sln' |
38 | 63 | inputs: |
39 | 64 | solution: Xamarin.Android.Tools.sln |
40 | | - - task: VSTest@2 |
| 65 | + |
| 66 | + - task: DotNetCoreCLI@2 |
41 | 67 | displayName: 'Run Tests' |
42 | 68 | inputs: |
43 | | - testAssemblyVer2: 'bin\TestDebug\*-Tests.dll' |
44 | | - testRunTitle: windows-tests |
| 69 | + command: test |
| 70 | + projects: bin/TestDebug-net*/**/*-Tests.dll |
| 71 | + testRunTitle: Xamarin.Android.Tools Tests - $(vmImage) |
| 72 | + |
45 | 73 | - powershell: | |
46 | 74 | $hashOfLastVersionChange = & "git" "log" "--follow" "-1" "--pretty=%H" "nuget.version" |
47 | 75 | $commitsSinceVersionChange = & "git" "rev-list" "--count" "$hashOfLastVersionChange..HEAD" |
48 | 76 | $majorMinor = Get-Content "nuget.version" |
49 | 77 | $version = "$majorMinor.$commitsSinceVersionChange" |
50 | 78 | Write-Host "##vso[task.setvariable variable=xat.nuget.version]$version" |
| 79 | + condition: and(succeeded(), eq(variables['agent.os'], 'Windows_NT')) |
| 80 | +
|
51 | 81 | - task: MSBuild@1 |
52 | 82 | displayName: 'Build NuGet' |
53 | 83 | inputs: |
54 | 84 | solution: 'src\Xamarin.Android.Tools.AndroidSdk\Xamarin.Android.Tools.AndroidSdk.csproj' |
55 | 85 | msbuildArguments: '/t:pack /p:Version=$(xat.nuget.version) /p:OutputPath=$(Build.ArtifactStagingDirectory)' |
| 86 | + condition: and(succeeded(), eq(variables['agent.os'], 'Windows_NT')) |
| 87 | + |
56 | 88 | - task: PublishBuildArtifacts@1 |
57 | 89 | displayName: Upload Artifacts |
58 | 90 | inputs: |
59 | 91 | pathtoPublish: $(Build.ArtifactStagingDirectory) |
60 | | -- job: mac |
61 | | - displayName: mac |
62 | | - pool: $(HostedMac) |
63 | | - steps: |
64 | | - - task: UseDotNet@2 |
65 | | - displayName: Use .NET Core $(DotNetCoreVersion) |
66 | | - inputs: |
67 | | - version: $(DotNetCoreVersion) |
68 | | - - script: | |
69 | | - dotnet tool install --global boots |
70 | | - boots https://download.mono-project.com/archive/6.4.0/macos-10-universal/MonoFramework-MDK-6.4.0.198.macos10.xamarin.universal.pkg |
71 | | - displayName: Install Mono 6.4 |
72 | | - - script: make prepare CONFIGURATION=$(Build.Configuration) |
73 | | - displayName: make prepare |
74 | | - |
75 | | - - script: make all CONFIGURATION=$(Build.Configuration) |
76 | | - displayName: make all |
77 | | - |
78 | | - - script: make run-all-tests CONFIGURATION=$(Build.Configuration) |
79 | | - displayName: make run-all-tests |
80 | | - |
81 | | - - task: PublishTestResults@2 |
82 | | - condition: always() |
83 | | - inputs: |
84 | | - testResultsFormat: NUnit |
85 | | - testResultsFiles: TestResult*.xml |
86 | | - testRunTitle: mac-tests |
87 | | - failTaskOnFailedTests: true |
| 92 | + condition: and(succeeded(), eq(variables['agent.os'], 'Windows_NT')) |
0 commit comments