Skip to content

Реализована простая макрокоманда, которая выполняет последовательность команд #60

Реализована простая макрокоманда, которая выполняет последовательность команд

Реализована простая макрокоманда, которая выполняет последовательность команд #60

Workflow file for this run

name: AppServer building
on:
pull_request:
branches: ["main"]
env:
DIR: ./appserver
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [ '7.0.x' ]
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
- uses: actions/cache@v3
with:
path: ${{ env.DIR }} /.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget
- name: Install dependencies
working-directory: ${{ env.DIR }}
run: dotnet restore
- name: Display dotnet version
working-directory: ${{ env.DIR }}
run: dotnet --version
- name: Build
working-directory: ${{ env.DIR }}
run: dotnet build --configuration Debug --no-restore /p:ContinuousIntegrationBuild=true
- name: Test
working-directory: ${{ env.DIR }}
run: dotnet test --configuration Debug --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:MergeWith=../coverage-${{ matrix.dotnet-version }}/opencover.json /p:CoverletOutput=../coverage-${{ matrix.dotnet-version }}/opencover.xml /maxcpucount:1
- name: Code Coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./appserver/coverage-${{ matrix.dotnet-version }}/opencover.xml
- name: Create Test Coverage Badge
uses: simon-k/[email protected]
id: create_coverage_badge
with:
label: Code Coverage
color: brightgreen
path: ./appserver/coverage-${{ matrix.dotnet-version }}/opencover.xml
gist-filename: code-coverage.json
gist-id: 12e789e4ad65907362af2ab12960b2ee
gist-auth-token: ${{ secrets.GIST_SECRET }}
- name: Print code coverage
run: echo "Code coverage percentage ${{steps.create_coverage_badge.outputs.percentage}}%"