Skip to content

Upd Sdk + fix NRE

Upd Sdk + fix NRE #10

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: Build
on:
workflow_dispatch:
push:
branches: [ "dev"]
paths-ignore:
- README.MD
- README_RU.MD
- LICENSE
pull_request:
paths-ignore:
- README.MD
- README_RU.MD
- LICENSE
jobs:
build_and_test:
runs-on: ubuntu-latest
env:
PackageOutputDir: ".packages"
TESTRESULTS_DIRECTORY: '.test_results'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '6.x'
- name: Determine Version
run: |
${GITVERSION_PATH}/dotnet-gitversion /output buildserver /output json
- name: Restore dependencies
run: dotnet restore
- name: Build
run: |
dotnet build --nologo --no-restore -p:AssemblyVersion=${GitVersion_AssemblySemVer} -p:FileVersion=${GitVersion_MajorMinorPatch} -p:Configuration=Release
- name: Test
run: |
dotnet tool install -g dotnet-reportgenerator-globaltool --ignore-failed-sources
dotnet test --no-restore --verbosity normal --results-directory="${TESTRESULTS_DIRECTORY}" --logger:trx --collect:"XPlat Code Coverage${CI_DOTNET_TEST_COLLECTOR_OPT}" --nologo || (true && echo "ERROR test failure" >> errors)
reportgenerator -reports:${TESTRESULTS_DIRECTORY}/**/coverage.cobertura.xml '-reporttypes:TextSummary' -targetdir:${TESTRESULTS_DIRECTORY}/CoverageReports
printf 'TEST_TOTAL_COVERAGE: ' && grep 'Line coverage:' ${TESTRESULTS_DIRECTORY}/CoverageReports/Summary.txt | awk -F': ' '{print $2}'
if [ -e errors ] ; then cat errors ; exit 1 ; fi
- name: Run codacy-coverage-reporter
uses: codacy/[email protected]
with:
project-token: ${{ secrets.CODACY_API_KEY }}
coverage-reports: ${{ env.TESTRESULTS_DIRECTORY }}/**/*cobertura.xml
- name: Archive test report
uses: actions/upload-artifact@v4
with:
name: test-report
path: ${{ env.TESTRESULTS_DIRECTORY }}/**/*.*