forked from DigitalRuby/IPBan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
45 lines (36 loc) · 1.42 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
trigger:
- master
strategy:
matrix:
linux:
imageName: 'ubuntu-latest'
windows:
imageName: 'windows-latest'
pool:
vmImage: $(imageName)
variables:
buildConfiguration: 'Release'
steps:
- task: UseDotNet@2
displayName: 'Install .Net SDK'
inputs:
packageType: 'sdk'
version: '8.x'
includePreviewVersions: false
installationPath: $(Agent.ToolsDirectory)/dotnet_latest
- script: sudo apt update -q -y && sudo apt install -q -y iptables ipset sysstat firewalld
displayName: 'Install dependencies on Linux'
condition: contains( variables['Agent.OS'], 'Linux' )
- task: NuGetToolInstaller@1
- task: DotNetCoreCLI@2
inputs:
command: restore
projects: './IPBanTests/IPBanTests.csproj'
- script: $(Agent.ToolsDirectory)/dotnet_latest/dotnet build --configuration $(buildConfiguration) ./IPBanTests/IPBanTests.csproj
displayName: 'Build All'
- script: sudo $(Agent.ToolsDirectory)/dotnet_latest/dotnet test --configuration $(buildConfiguration) ./IPBanTests/IPBanTests.csproj
displayName: 'Test Linux'
condition: contains( variables['Agent.OS'], 'Linux' )
- script: $(Agent.ToolsDirectory)/dotnet_latest/dotnet test --configuration $(buildConfiguration) ./IPBanTests/IPBanTests.csproj
displayName: 'Test Windows'
condition: contains( variables['Agent.OS'], 'Windows' )