Skip to content

Instantly share code, notes, and snippets.

@AlexZeitler
Created January 10, 2021 22:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexZeitler/f73178d8523cf846845c0fe0e4d2e525 to your computer and use it in GitHub Desktop.
Save AlexZeitler/f73178d8523cf846845c0fe0e4d2e525 to your computer and use it in GitHub Desktop.
.NET Core GitHub Action Template
name: .NET Core Build with Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
# use ubuntu for more build minutes
runs-on: ubuntu-latest
# use release mode for all steps
env:
config: 'Release'
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.101
# restore dependencies
- name: Install dependencies
run: |
cd src
dotnet restore
# build project
- name: Build
run: |
cd src
dotnet build --configuration $config --no-restore
- name: Test
run: |
cd src
dotnet test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment