diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 890e3a1..26b9117 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,16 +14,35 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: 9.0.x - - name: Restore dependencies + - name: Restore run: dotnet restore -p:NuGetAudit=true -p:NuGetAuditMode=All -p:NuGetAuditLevel=Moderate -p:TreatWarningsAsErrors=true - name: Build run: dotnet build --no-restore - name: Test run: | - cd tests/Fresp.Tests - dotnet test /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov + dotnet test /p:CollectCoverage=true /p:CoverletOutput=../../TestResults/ /p:CoverletOutputFormat=lcov + - name: Archive code coverage results + uses: actions/upload-artifact@v4 + with: + name: code-coverage-report + path: TestResults/coverage.info + retention-days: 1 + + publish-coverage: + needs: code-validation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 9.0.x + - name: Download code coverage results + uses: actions/download-artifact@v4 + with: + name: code-coverage-report - name: Publish coverage report to coveralls.io uses: coverallsapp/github-action@master with: github-token: ${{ secrets.github_token }} - path-to-lcov: tests/Fresp.Tests/TestResults/coverage.info \ No newline at end of file + path-to-lcov: coverage.info diff --git a/README.md b/README.md index 3373f41..aaf5c8b 100644 --- a/README.md +++ b/README.md @@ -102,4 +102,4 @@ If the request predicate is matched, the following configured response will be r ## License -This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. \ No newline at end of file +This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.