From bde6d6a149984f937b6266b8b2298c7dc9f5616b Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Fri, 3 Jul 2020 00:38:19 -0700 Subject: [PATCH] Updates CI with Azure Pipelines (#170) --- .github/workflows/dotnet-core.yml | 28 ++-------- README.md | 1 + azure-pipelines.yml | 87 +++++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+), 24 deletions(-) create mode 100644 azure-pipelines.yml diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml index 38a88fe67..146eb28eb 100644 --- a/.github/workflows/dotnet-core.yml +++ b/.github/workflows/dotnet-core.yml @@ -13,39 +13,19 @@ jobs: fail-fast: false matrix: include: - - os: windows-latest - rid: win-x64 - - os: ubuntu-latest - rid: linux-x64 - os: macos-latest - rid: osx-x64 steps: - uses: actions/checkout@v2 - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 3.1.300 - - name: NuGet Cache - 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' + dotnet-version: 3.1.301 + - name: Restore NuGet Packages run: dotnet restore --force-evaluate - name: Build Server run: dotnet build -c Release --no-restore Projects/Server/Server.csproj - name: Build UO Content run: dotnet build -c Release --no-restore Projects/UOContent/UOContent.csproj - - name: Test Server - run: dotnet test -r ${{ matrix.rid }} --no-restore Projects/Server.Tests/Server.Tests.csproj - - name: Test UOContent - run: dotnet test -r ${{ matrix.rid }} --no-restore Projects/UOContent.Tests/UOContent.Tests.csproj + - name: Test + run: dotnet test --no-restore diff --git a/README.md b/README.md index 8f23d9c23..5ced03aec 100644 --- a/README.md +++ b/README.md @@ -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 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) +[![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 - See [Goals](./GOALS.md) diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 000000000..25ec6be61 --- /dev/null +++ b/azure-pipelines.yml @@ -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'