-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathazure-pipelines.yml
81 lines (69 loc) · 1.97 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
trigger:
branches:
include:
- '*'
tags:
include:
- '*'
resources:
repositories:
- repository: "Azure Repos Mirror"
type: git
name: efcore/efcore-ext
variables:
- group: azure-repos-sync
jobs:
- job: Build
displayName: "Build, Test and Publish"
pool:
vmImage: windows-2022
steps:
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
Write-Host "> Setting up PostgreSQL"
$postgresService = Get-Service postgresql* | select -First 1
Set-Service -InputObject $postgresService -StartupType Manual
net start $postgresService.Name
Write-Host ""
Write-Host "> Setting up MySQL"
mysqld --initialize-insecure
mysqld install
$mysqlService = Get-Service mysql* | select -First 1
net start $mysqlService.Name
mysql -u root --skip-password -e "ALTER USER 'root'@'localhost' IDENTIFIED BY 'Password12!'; FLUSH PRIVILEGES;"
Write-Host ""
Write-Host "> Listing .NET SDKs"
dotnet --list-sdks
displayName: 'Setup Environment'
- task: DotNetCoreCLI@2
inputs:
command: 'build'
displayName: 'Restore and Build Plugin'
- task: DotNetCoreCLI@2
inputs:
command: 'test'
arguments: '--no-restore --collect "Code coverage"'
displayName: 'Run Unit Tests'
- task: DotNetCoreCLI@2
inputs:
command: 'custom'
custom: 'pack'
arguments: '--no-restore -c Release -o $(Build.ArtifactStagingDirectory)'
displayName: 'Package for NuGet'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
displayName: 'Publish Artifacts'
- job: Sync
displayName: "Sync with Azure Repos"
pool:
vmImage: windows-latest
steps:
- task: gitmirror@0
inputs:
GitRepoUrl: 'https://tlylz:$(SYNC_PAT)@dev.azure.com/tlylz/efcore/_git/efcore-ext'
displayName: 'Sync via Git Tools'