|
8 | 8 |
|
9 | 9 | jobs: |
10 | 10 | build: |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + dotnet: [ '3.1.x' ] |
| 14 | + name: Dotnet ${{ matrix.dotnet }} |
11 | 15 |
|
12 | 16 | runs-on: ubuntu-latest |
13 | 17 |
|
14 | 18 | steps: |
15 | | - - uses: actions/checkout@v2 |
16 | | - - name: Setup .NET Core |
17 | | - uses: actions/setup-dotnet@v1 |
18 | | - with: |
19 | | - dotnet-version: 3.1.301 |
20 | | - - name: Install dependencies |
21 | | - run: dotnet restore |
22 | | - - name: Build |
23 | | - run: dotnet build --configuration Release --no-restore |
24 | | - - name: Test |
25 | | - run: dotnet test --no-restore --verbosity normal |
| 19 | + - uses: actions/checkout@v2 |
| 20 | + - name: Setup .NET Core |
| 21 | + uses: actions/setup-dotnet@v1 |
| 22 | + with: |
| 23 | + dotnet-version: ${{matrix.dotnet}} |
| 24 | + - name: Install dependencies |
| 25 | + run: dotnet restore |
| 26 | + - name: Build |
| 27 | + run: dotnet build --configuration Release --no-restore |
| 28 | + - name: Test |
| 29 | + run: dotnet test --no-restore --verbosity normal /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=opencover |
| 30 | + |
| 31 | + - name: Create the package |
| 32 | + run: dotnet pack --configuration Release System.Text.Json.Extensions |
| 33 | + - uses: actions/upload-artifact@v2 |
| 34 | + with: |
| 35 | + name: Dotnet ${{ matrix.dotnet }} |
| 36 | + path: System.Text.Json.Extensions/bin/Release/ |
| 37 | + if-no-files-found: error |
| 38 | + |
| 39 | + - name: ReportGenerator |
| 40 | + uses: danielpalme/ReportGenerator-GitHub-Action@4.5.8 |
| 41 | + with: |
| 42 | + reports: '**/TestResults/coverage.opencover.xml' # REQUIRED # The coverage reports that should be parsed (separated by semicolon). Globbing is supported. |
| 43 | + targetdir: 'coveragereport' # REQUIRED # The directory where the generated report should be saved. |
| 44 | + reporttypes: 'HtmlInline' # The output formats and scope (separated by semicolon) Values: Badges, Clover, Cobertura, CsvSummary, Html, HtmlChart, HtmlInline, HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlSummary, JsonSummary, Latex, LatexSummary, lcov, MHtml, PngChart, SonarQube, TeamCitySummary, TextSummary, Xml, XmlSummary |
| 45 | + verbosity: 'Info' # The verbosity level of the log messages. Values: Verbose, Info, Warning, Error, Off |
| 46 | + tag: '${{ github.run_number }}_${{ github.run_id }}' # Optional tag or build version. |
| 47 | + - uses: actions/upload-artifact@v2 |
| 48 | + with: |
| 49 | + name: Dotnet ${{ matrix.dotnet }} coveragereport |
| 50 | + path: coveragereport/ |
| 51 | + if-no-files-found: error |
| 52 | + |
| 53 | + - name: Setup .NET Core for GPR |
| 54 | + uses: actions/setup-dotnet@v1 |
| 55 | + with: |
| 56 | + dotnet-version: ${{matrix.dotnet}} |
| 57 | + source-url: https://nuget.pkg.github.com/TheConstructor/index.json |
| 58 | + env: |
| 59 | + NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} |
| 60 | + - name: Publish the package to GPR |
| 61 | + if: success() && github.event_name == 'push' && matrix.dotnet == '3.1.x' |
| 62 | + run: dotnet nuget push System.Text.Json.Extensions/bin/Release/ |
0 commit comments