Skip to content

Feature/add working directory override (#59) #40

Feature/add working directory override (#59)

Feature/add working directory override (#59) #40

Workflow file for this run

name: build
on:
push:
branches:
- main
- release-*
- feature-*
tags:
- v*
pull_request:
branches:
- main
- release-*
jobs:
build:
name: Build
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Parse release version
run: python ./.github/scripts/get_release_version.py
- name: Build
run: dotnet build --configuration release
- name: Generate Packages
run: dotnet pack --configuration release
test:
name: Unit Tests
runs-on: windows-latest
strategy:
matrix:
dotnet-version: ['net35', 'net48', 'net50']
include:
- dotnet-version: 'net35'
display-name: '.NET Framework 3.5'
framework: 'net35'
logger: '--logger="trx"'
- dotnet-version: 'net48'
display-name: '.NET Framework 4.8'
framework: 'net48'
logger: '--logger="GitHubActions;report-warnings=false" --logger="trx"'
- dotnet-version: 'net50'
display-name: '.NET 5.0'
framework: 'net5.0'
logger: '--logger="GitHubActions;report-warnings=false" --logger="trx"'
steps:
- uses: actions/checkout@v2
- name: Parse release version
run: python ./.github/scripts/get_release_version.py
- name: Test
continue-on-error: true # proceed if tests fail, the report step will report the failure with more details.
run: dotnet test -c release -f ${{ matrix.framework }} ${{ matrix.logger }} -r "${{ github.workspace }}/TestResults" /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:GITHUB_ACTIONS=false
- name: Upload test coverage
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
flags: ${{ matrix.framework }}
- name: Parse Trx files
uses: NasAmin/trx-parser@v0.1.0
id: trx-parser
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository # does not work on PRs from forks
with:
TRX_PATH: ${{ github.workspace }}/TestResults
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}