Skip to content

initial commit

initial commit #17

name: Build And Test RES.Configuration
on:
push:
branches:
- "master"
paths-ignore:
- '**.md'
pull_request:
workflow_dispatch:
jobs:
Build_And_Test:
name: Build
runs-on: windows-2019
steps:
- name: Checkout PR merged with Master
uses: actions/checkout@v3
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
with:
ref: refs/pull/${{ github.event.number }}/merge
- name: Checkout Master
uses: actions/checkout@v3
if: github.event_name != 'pull_request' && github.event_name != 'pull_request_target'
- name: Use .NET Core SDK 5.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 5.0.x
- name: Install OpenCover
run: choco install opencover.portable
- name: Install nunit-console
run: |
msiexec /i D:\a\configuration\configuration\NUnit.Console-3.15.4.msi /qn /norestart
- name: Restore RES.Configuration
run: dotnet restore RES.Configuration.sln
- name: Build RES.Configuration
run: dotnet build RES.Configuration.sln --configuration Release --no-restore
- name: Run OpenCover
run: |
C:\ProgramData\chocolatey\lib\opencover.portable\tools\\OpenCover.Console.exe -register:Path64 -target:"C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe" -targetargs:"${{ github.workspace }}\BuiltDlls\Release\RES.Configuration.Test.dll" -output:"coverage.xml" -returntargetcode --shadowcopy
shell: cmd
- name: Upload Test and Coverage Reports to Artifacts
uses: actions/upload-artifact@v3
with:
name: test-and-coverage-results
path: |
TestResult.xml
coverage.xml
- name: Create nuget package
run: |
dotnet pack RES.Configuration/RES.Configuration.csproj --configuration Release --no-restore --no-build --output ${{ github.workspace }}/artifacts
- name: Upload nuget package to Artifacts
uses: actions/upload-artifact@v3
with:
name: RES.Configuration
path: |
artifacts/*.nupkg