Skip to content

Commit

Permalink
Add CI workflow for all branches & PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
DamianEdwards committed Sep 14, 2021
1 parent 9343677 commit 0766071
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/dotnet-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: .NET Build/Test all branches/PRs

on:
push:
pull_request:
paths-ignore:
- '**/*.md'
- '**/*.gitignore'
- '**/*.gitattributes'

workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
name: Build, test, and pack

steps:
- uses: actions/checkout@v2

- name: Setup .NET SDK
uses: actions/setup-dotnet@v1

- name: Restore dependencies
run: dotnet restore

- name: Set current date as env variable
run: echo "NOW=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV

- name: Create build number
run: echo "BUILD_NUMBER=$NOW.$GITHUB_RUN_NUMBER" >> $GITHUB_ENV

- name: Build
run: dotnet build --configuration Release --no-restore /p:VersionSuffix=ci /p:BuildNumber=$BUILD_NUMBER /p:SourceRevisionId=$GITHUB_SHA /p:ContinuousIntegrationBuild=true

- name: Test
run: dotnet test --verbosity normal

- name: Pack
run: dotnet pack --no-build --configuration Release --verbosity d /p:VersionSuffix=ci /p:BuildNumber=$BUILD_NUMBER /p:SourceRevisionId=$GITHUB_SHA /p:ContinuousIntegrationBuild=true

0 comments on commit 0766071

Please sign in to comment.