Skip to content

Commit

Permalink
chore(ci): add code coverage support
Browse files Browse the repository at this point in the history
  • Loading branch information
evansims committed Apr 4, 2024
1 parent 39fecdd commit 8f990ee
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
coverage:
precision: 2
range: "60...80"
round: down
15 changes: 11 additions & 4 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,20 @@ jobs:
run: dotnet build --no-restore

- name: Test
run: dotnet test --no-build --verbosity normal
run: dotnet test --no-build --verbosity normal --collect "Code Coverage"

- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 #v4.3.1
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.1
with:
name: nuget-package
path: src/OpenFga.Sdk/bin/Release/OpenFga.Sdk.*.nupkg

- name: Upload coverage to Codecov
uses: codecov/codecov-action@c16abc29c95fcf9174b58eb7e1abf4c866893bc8 # v4.1.1
continue-on-error: true
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: openfga/dotnet-sdk

publish:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
Expand All @@ -58,7 +65,7 @@ jobs:
- name: Build
run: dotnet build --no-restore --configuration Release

- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 #v4.3.1
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.1
with:
name: nuget-package
path: src/OpenFga.Sdk/bin/Release/OpenFga.Sdk.*.nupkg
Expand All @@ -78,7 +85,7 @@ jobs:
with:
fetch-depth: 0

- uses: Roang-zero1/github-create-release-action@57eb9bdce7a964e48788b9e78b5ac766cb684803
- uses: Roang-zero1/github-create-release-action@57eb9bdce7a964e48788b9e78b5ac766cb684803 # v3.0.1
with:
version_regex: ^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+
env:
Expand Down

0 comments on commit 8f990ee

Please sign in to comment.