Skip to content

Instantly share code, notes, and snippets.

@tonytins
Last active September 17, 2020 22:15
Show Gist options
  • Save tonytins/8bdd366bff80f0e26b8ad2b47745a9c9 to your computer and use it in GitHub Desktop.
Save tonytins/8bdd366bff80f0e26b8ad2b47745a9c9 to your computer and use it in GitHub Desktop.
Continuous integration for .NET. This assumes everything is in the /src directory.
name: .NET Core
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
dotnet: ["3.1.200", "3.1.201"]
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Install dependencies
run: dotnet restore src
- name: Build
run: dotnet build src --configuration Release --no-restore
name: .NET Framework
on: [push, pull_request]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup msbuild
uses: microsoft/[email protected]
- name: Install dependencies
run: nuget restore src
- name: Build
run: msbuild src /verbosity:normal /p:Configuration=Release
dist: xenial
addons:
snaps:
- name: dotnet-sdk
classic: true
channel: lts/stable
sudo: required
language: csharp
mono: none
script:
- sudo snap alias dotnet-sdk.dotnet dotnet
- dotnet restore src
- dotnet build src -c Release --no-restore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment