Updates CI with Azure Pipelines (#170)

This commit is contained in:
Kamron Batman 2020-07-03 00:38:19 -07:00 committed by GitHub
parent 997691fbb7
commit bde6d6a149
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 92 additions and 24 deletions

View file

@ -13,39 +13,19 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
- os: windows-latest
rid: win-x64
- os: ubuntu-latest
rid: linux-x64
- os: macos-latest - os: macos-latest
rid: osx-x64
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Setup .NET Core - name: Setup .NET Core
uses: actions/setup-dotnet@v1 uses: actions/setup-dotnet@v1
with: with:
dotnet-version: 3.1.300 dotnet-version: 3.1.301
- name: NuGet Cache - name: Restore NuGet Packages
id: nuget-cache
uses: actions/cache@v2
with:
path: |
~/.nuget/packages
${{ github.workspace }}/Projects/*/obj/project.assets.json
${{ github.workspace }}/Projects/*/obj/project.nuget.cache
${{ github.workspace }}/Projects/*/obj/*.csproj.nuget.*
key: ${{ matrix.os }}-nuget-cache-v7-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ matrix.os }}-nuget-cache-v7
- name: Restore dependencies
if: steps.nuget-cache.outputs.cache-hit != 'true' || steps.zlib-cache.outputs.cache-hit != 'true'
run: dotnet restore --force-evaluate run: dotnet restore --force-evaluate
- name: Build Server - name: Build Server
run: dotnet build -c Release --no-restore Projects/Server/Server.csproj run: dotnet build -c Release --no-restore Projects/Server/Server.csproj
- name: Build UO Content - name: Build UO Content
run: dotnet build -c Release --no-restore Projects/UOContent/UOContent.csproj run: dotnet build -c Release --no-restore Projects/UOContent/UOContent.csproj
- name: Test Server - name: Test
run: dotnet test -r ${{ matrix.rid }} --no-restore Projects/Server.Tests/Server.Tests.csproj run: dotnet test --no-restore
- name: Test UOContent
run: dotnet test -r ${{ matrix.rid }} --no-restore Projects/UOContent.Tests/UOContent.Tests.csproj

View file

@ -13,6 +13,7 @@ ModernUO [![Discord](https://img.shields.io/discord/458277173208547350?logo=disc
[![GitHub stars](https://img.shields.io/github/stars/modernuo/ModernUO?logo=github)](https://github.com/modernuo/ModernUO/stargazers) [![GitHub stars](https://img.shields.io/github/stars/modernuo/ModernUO?logo=github)](https://github.com/modernuo/ModernUO/stargazers)
[![GitHub issues](https://img.shields.io/github/issues/modernuo/ModernUO?logo=github)](https://github.com/modernuo/ModernUO/issues) [![GitHub issues](https://img.shields.io/github/issues/modernuo/ModernUO?logo=github)](https://github.com/modernuo/ModernUO/issues)
[![GitHub build](https://img.shields.io/github/workflow/status/modernuo/ModernUO/Build?logo=github)](https://github.com/modernuo/ModernUO/actions) [![GitHub build](https://img.shields.io/github/workflow/status/modernuo/ModernUO/Build?logo=github)](https://github.com/modernuo/ModernUO/actions)
[![AzurePipelines build](https://dev.azure.com/modernuo/modernuo/_apis/build/status/Build?branchName=master)](https://dev.azure.com/modernuo/modernuo/_build/latest?definitionId=1&branchName=master)
## Goals ## Goals
- See [Goals](./GOALS.md) - See [Goals](./GOALS.md)

87
azure-pipelines.yml Normal file
View file

@ -0,0 +1,87 @@
name: 'Build'
trigger:
- master
variables:
buildConfiguration: 'Release'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
jobs:
- job: BuildWindows
displayName: 'Windows Server 2019'
pool:
vmImage: 'windows-latest'
steps:
- task: DotNetCoreCLI@2
inputs:
command: 'custom'
custom: 'restore'
arguments: '--force-evaluate'
displayName: 'Restore NuGet Packages'
- task: DotNetCoreCLI@2
inputs:
command: 'build'
arguments: '-c $(buildConfiguration) --no-restore'
projects: '**/Projects/Server/Server.csproj'
displayName: 'Build Server'
- task: DotNetCoreCLI@2
inputs:
command: 'build'
arguments: '-c $(buildConfiguration) --no-restore'
projects: '**/Projects/UOContent/UOContent.csproj'
displayName: 'Build UO Content'
- task: DotNetCoreCLI@2
inputs:
command: 'test'
arguments: '--no-restore'
displayName: 'Test'
- job: BuildLinux
strategy:
matrix:
'Debian 10':
containerImage: mcr.microsoft.com/dotnet/core/sdk:3.1-buster
'Ubuntu 18':
containerImage: mcr.microsoft.com/dotnet/core/sdk:3.1-bionic
# 'Ubuntu 20':
# containerImage: mcr.microsoft.com/dotnet/core/sdk:3.1-focal
displayName: Linux
pool:
vmImage: 'ubuntu-latest'
container: $[ variables['containerImage'] ]
steps:
- task: DotNetCoreCLI@2
inputs:
command: 'custom'
custom: 'restore'
arguments: '--force-evaluate'
displayName: 'Restore NuGet Packages'
- task: DotNetCoreCLI@2
inputs:
command: 'build'
arguments: '-c $(buildConfiguration) --no-restore'
projects: '**/Projects/Server/Server.csproj'
displayName: 'Build Server'
- task: DotNetCoreCLI@2
inputs:
command: 'build'
arguments: '-c $(buildConfiguration) --no-restore'
projects: '**/Projects/UOContent/UOContent.csproj'
displayName: 'Build UO Content'
- task: DotNetCoreCLI@2
inputs:
command: 'test'
arguments: '--no-restore'
displayName: 'Test'