Skip to content

Commit

Permalink
integration test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dansiegel committed Sep 28, 2020
1 parent 7c75367 commit 1b32bf8
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 5 deletions.
7 changes: 7 additions & 0 deletions E2E/CI.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>
<Import Project="../Directory.Build.props" />
<ItemGroup>
<PackageReference Include="Mobile.BuildTools" VersionOverride="GeneratedPackageVersion" PrivateAssets="all" />
<PackageReference Include="Mobile.BuildTools.Configuration" VersionOverride="GeneratedPackageVersion" />
</ItemGroup>
</Project>
33 changes: 33 additions & 0 deletions build/Update-IntegrationVersion.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
$searchPath = Get-Location
$e2eDirectory = Join-Path -Path $searchPath -ChildPath "E2E"

if ($null -ne $env:PIPELINE_WORKSPACE)
{
$e2eDirectory = Join-Path -Path $env:BUILD_SOURCESDIRECTORY -ChildPath 'E2E'
}

Write-Host "Search Path: $searchPath"
Write-Host "Files in Path"
ls

$nupkg = Get-ChildItem -Path $searchPath -Filter *.nupkg -Recurse | Select-Object -First 1

Write-Host "Found Packge: $($nupkg.Name)"

$nupkg.Name -match '^(.*)((?:\.\d+){3,}(?:[-a-z\d]+))\.nupkg$'

$VersionName = $Matches[2]

if($VersionName.StartsWith('.'))
{
$VersionName = $VersionName.Substring(1)
}

Write-Host "Vesion Name: $VersionName"

$props = (Get-Content "$e2eDirectory\CI.props") -replace 'GeneratedPackageVersion', $VersionName

Write-Host "Updated Props: "
Write-Host $props

Out-File -FilePath "$e2eDirectory\Directory.Build.props" -InputObject $props -Force
1 change: 1 addition & 0 deletions build/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ stages:
vmImage: $(MacAgent)
jobName: IntegrationTestsMac
displayName: Integration Tests (Mac)
runBoots: true

# - template: jobs/android.yml
# parameters:
Expand Down
21 changes: 18 additions & 3 deletions build/jobs/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
parameters:
solution: '**/*.sln'
vmImage: ''
jobName: ''
- name: solution
type: string
default: '**/*.sln'
- name: vmImage
type: string
default: ''
- name: jobName
type: string
default: ''
- name: displayName
type: string
default: 'Integration Tests'
- name: runBoots
type: boolean
default: false

jobs:
- job: ${{ parameters.jobName }}
Expand All @@ -11,6 +23,9 @@ jobs:
demands:
- msbuild
steps:
- ${{ if eq(parameters.runBoots, true) }}:
- template: ../steps/boots.yml

- template: ../steps/setup-dotnetcore.yml

- template: ../steps/local-nuget-restore.yml
Expand Down
7 changes: 7 additions & 0 deletions build/steps/boots.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
steps:
- script: |
dotnet tool install --global boots
boots --stable Mono
boots --stable XamarinAndroid
boots --stable XamariniOS
displayName: 'Install latest Mono Version'
10 changes: 8 additions & 2 deletions build/steps/local-nuget-restore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,17 @@ steps:
artifactName: 'Artifacts'
downloadPath: $(Pipeline.Workspace)

- task: PowerShell@2
displayName: Update Version Override
inputs:
filePath: 'build/Update-IntegrationVersion.ps1'
workingDirectory: '$(Pipeline.Workspace)'

- powershell: |
nuget help | head -1
nuget locals global-packages -clear
nuget restore -source "$($env:PIPELINE_WORKSPACE);https://api.nuget.org/v3/index.json"
nuget restore -Source "$($env:PIPELINE_WORKSPACE)/Artifacts;https://api.nuget.org/v3/index.json" -Recursive -ForceEvaluate -NonInteractive -Verbosity detailed
workingDirectory: ${{ parameters.workingDirectory }}
displayName: 'NuGet Restore'
displayName: 'Local NuGet Restore'

0 comments on commit 1b32bf8

Please sign in to comment.