Adds github action (#151)

This commit is contained in:
Kamron Batman 2020-05-27 14:49:07 -07:00 committed by GitHub
parent efbbd4c324
commit 012c5fa9b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 80 additions and 60 deletions

View file

@ -1,58 +0,0 @@
version: 2.1
orbs:
win: circleci/windows@2.4.0
executors:
linux-build:
description: "Executor using Debian and .NET Core 3.1"
docker:
- image: mcr.microsoft.com/dotnet/core/sdk:3.1-buster
working_directory: /mnt/ramdisk
jobs:
build_linux:
description: Build ModernUO with Debian
executor: linux-build
steps:
- run: rm -rf ~/project/.git # CircleCI git caching is likely broken
- checkout
- run:
name: Building ModernUO for Linux
command: Tools/publish.cmd linux
build_windows:
description: Build application
executor: win/default
steps:
- checkout
- run:
name: Building ModernUO for Windows
command: Tools/publish.cmd win
code_styling:
description: Code analysis
executor: linux-build
steps:
- run: rm -rf ~/project/.git # CircleCI git caching is likely broken
- checkout
- run:
name: Building with Analyzers
command: Tools/publish.cmd linux Analyze
tests:
description: Unit Tests
executor: linux-build
steps:
- run: rm -rf ~/project/.git # CircleCI git caching is likely broken
- checkout
- run:
name: Build native libraries
command: /mnt/ramdisk/Tools/build-native-libraries.sh
- run:
name: Running unit tests
command: dotnet test -r linux-x64
workflows:
build-and-test:
jobs:
- build_linux
- build_windows
- code_styling
- tests

78
.github/workflows/dotnet-core.yml vendored Normal file
View file

@ -0,0 +1,78 @@
name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
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
uses: actions/cache@v2
with:
path: |
~/.nuget/packages
!~/.nuget/packages/argon2.bindings
!~/.nuget/packages/zlib.bindings
key: ${{ matrix.os }}-nuget-${{ hashFiles('Projects/**/*.csproj') }}
restore-keys: |
${{ matrix.os }}-nuget-
- name: Argon2 Library Cache
id: argon2-cache
uses: actions/cache@v2
with:
path: |
~/.nuget/packages/argon2.bindings
Projects/ZLib/*
packages/Argon2.Bindings*.nupkg
key: ${{ matrix.os }}-argon2-${{ hashFiles('Projects/Argon2/*') }}
restore-keys: |
${{ matrix.os }}-argon2-
- name: ZLib Library Cache
id: zlib-cache
uses: actions/cache@v2
with:
path: |
~/.nuget/packages/zlib.bindings
Projects/ZLib/*
packages/ZLib.Bindings*.nupkg
key: ${{ matrix.os }}-argon2-${{ hashFiles('Projects/Argon2/*') }}
restore-keys: |
${{ matrix.os }}-argon2-
- name: Build ZLib
if: steps.zlib-cache.outputs.cache-hit != 'true'
run: |
dotnet build -c Release Projects/ZLib/ZLib.csproj
dotnet pack -c Release -o packages Projects/ZLib/ZLib.csproj
- name: Build Argon2
if: steps.argon2-cache.outputs.cache-hit != 'true'
run: |
dotnet build -c Release Projects/Argon2/Argon2.csproj
dotnet pack -c Release -o packages Projects/Argon2/Argon2.csproj
- name: Install dependencies
run: dotnet restore
- 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
run: dotnet test -r ${{ matrix.rid }} --no-restore --verbosity normal

View file

@ -12,14 +12,14 @@ ModernUO [![Discord](https://img.shields.io/discord/458277173208547350?logo=disc
[![GitHub license](https://img.shields.io/github/license/modernuo/ModernUO?color=blue)](https://github.com/modernuo/ModernUO/blob/master/LICENSE)
[![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)
[![Build status](https://img.shields.io/circleci/build/gh/modernuo/ModernUO/master?logo=circleci)](https://circleci.com/gh/modernuo/ModernUO)
[![GitHub build](https://img.shields.io/github/workflow/status/modernuo/ModernUO/Build%20(.NET%20Core%203.1)?logo=github)](https://github.com/modernuo/ModernUO/actions)
## Goals
- See [Goals](./GOALS.md)
## Publishing a build
#### Requirements
- [.NET Core 3.1 SDK](https://dotnet.microsoft.com/download/dotnet-core/3.1)
- [.NET Core 3.1.4 SDK](https://dotnet.microsoft.com/download/dotnet-core/3.1)
#### Publishing
OSX/Linux