Skip to content

Commit

Permalink
added ci for code coverage and build
Browse files Browse the repository at this point in the history
  • Loading branch information
Eliaxie committed Jul 26, 2023
1 parent 9efdf0e commit 763a852
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
File renamed without changes.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI

on:
push:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
bots:
- PoliNetworkBot
defaults:
run:
working-directory: ${{ matrix.bots }}
steps:
- uses: actions/checkout@v2

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0.x'

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore

- name: Test
run: dotnet test --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./${{ matrix.bots }}/coverage.opencover.xml
7 changes: 7 additions & 0 deletions PoliNetworkBot/PoliNetworkBot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,11 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>

0 comments on commit 763a852

Please sign in to comment.