From 8f990ee7a6adf1bbed1736fff5c108f8461a57fe Mon Sep 17 00:00:00 2001 From: Evan Sims Date: Wed, 3 Apr 2024 20:52:24 -0500 Subject: [PATCH 1/3] chore(ci): add code coverage support --- .codecov.yml | 4 ++++ .github/workflows/main.yaml | 15 +++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 .codecov.yml diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 0000000..0385c10 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,4 @@ +coverage: + precision: 2 + range: "60...80" + round: down diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 32cd811..a9af0b1 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -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') @@ -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 @@ -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: From 0824615aa7dde77a30a146253617833c96f2e0a8 Mon Sep 17 00:00:00 2001 From: Evan Sims Date: Wed, 3 Apr 2024 20:52:24 -0500 Subject: [PATCH 2/3] chore(ci): add code coverage support --- .codecov.yml | 4 ++++ .github/workflows/main.yaml | 15 +++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 .codecov.yml diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 0000000..0385c10 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,4 @@ +coverage: + precision: 2 + range: "60...80" + round: down diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 32cd811..a9af0b1 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -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') @@ -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 @@ -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: From 24f085159dd89af297de7bfad9942feb067175ec Mon Sep 17 00:00:00 2001 From: Evan Sims Date: Wed, 3 Apr 2024 21:04:46 -0500 Subject: [PATCH 3/3] Update FILES --- .openapi-generator/FILES | 1 + 1 file changed, 1 insertion(+) diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 76d6536..e35b6e9 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.codecov.yml .editorconfig .fossa.yml .github/CODEOWNERS