diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7497bdf05..5518a0464 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,42 @@ jobs: with: fetch-depth: 0 - name: Run tests - run: dotnet test --verbosity normal + run: dotnet test --verbosity normal --collect:"XPlat Code Coverage" + - name: Upload coverage + uses: actions/upload-artifact@v2 + with: + name: Code coverage ${{ matrix.os }} + path: "**/coverage.cobertura.xml" + coverage: + name: Coverage + needs: [test] + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + - uses: actions/download-artifact@v2 + with: + name: Code coverage ubuntu-latest + path: coverage-ubuntu + - uses: actions/download-artifact@v2 + with: + name: Code coverage windows-latest + path: coverage-windows + - uses: actions/download-artifact@v2 + with: + name: Code coverage macos-latest + path: coverage-macos + - name: Generate coverage report + uses: danielpalme/ReportGenerator-GitHub-Action@4.7.1 + with: + reports: "**/coverage.cobertura.xml" + targetdir: "coverage-report" + reporttypes: "Cobertura" + - name: Publish coverage report to Codacy + uses: codacy/codacy-coverage-reporter-action@master + with: + project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} + coverage-reports: coverage-report/Cobertura.xml pack: name: Pack needs: [test] @@ -28,10 +63,6 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 - - name: Install .NET Core 3.1 SDK - uses: actions/setup-dotnet@v1 - with: - dotnet-version: "3.1.x" - name: Create packages run: dotnet pack --configuration Release --output ./packages - name: Upload a Build Artifact @@ -53,7 +84,7 @@ jobs: with: name: NuGet packages path: packages - - name: Push packages + - name: Push packages run: dotnet nuget push "packages/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json - uses: dotnet/nbgv@v0.3.1 id: nbgv @@ -61,6 +92,6 @@ jobs: uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: + with: tag_name: v${{ steps.nbgv.outputs.SemVer2 }} release_name: v${{ steps.nbgv.outputs.SemVer2 }} diff --git a/global.json b/global.json new file mode 100644 index 000000000..a7f328498 --- /dev/null +++ b/global.json @@ -0,0 +1,6 @@ +{ + "sdk": { + "version": "3.1.302", + "rollForward": "latestMinor" + } +} diff --git a/tests/System.IO.Abstractions.TestingHelpers.Tests/System.IO.Abstractions.TestingHelpers.Tests.csproj b/tests/System.IO.Abstractions.TestingHelpers.Tests/System.IO.Abstractions.TestingHelpers.Tests.csproj index d00e39f75..235b3171d 100644 --- a/tests/System.IO.Abstractions.TestingHelpers.Tests/System.IO.Abstractions.TestingHelpers.Tests.csproj +++ b/tests/System.IO.Abstractions.TestingHelpers.Tests/System.IO.Abstractions.TestingHelpers.Tests.csproj @@ -21,6 +21,10 @@ + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + diff --git a/tests/System.IO.Abstractions.Tests/System.IO.Abstractions.Tests.csproj b/tests/System.IO.Abstractions.Tests/System.IO.Abstractions.Tests.csproj index 66459ff3f..4ff4dcf04 100644 --- a/tests/System.IO.Abstractions.Tests/System.IO.Abstractions.Tests.csproj +++ b/tests/System.IO.Abstractions.Tests/System.IO.Abstractions.Tests.csproj @@ -12,6 +12,10 @@ + + runtime; build; native; contentfiles; analyzers; buildtransitive + all +