|
| 1 | +name: Code coverage |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - dev |
| 7 | + |
| 8 | +jobs: |
| 9 | + extender: |
| 10 | + runs-on: ubuntu-22.04 |
| 11 | + steps: |
| 12 | + - name: Checkout repo |
| 13 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 |
| 14 | + - name: Install Java |
| 15 | + uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 |
| 16 | + with: |
| 17 | + java-version: '21.0.5+11.0.LTS' |
| 18 | + distribution: 'temurin' |
| 19 | + - name: Setup Gradle |
| 20 | + uses: gradle/actions/setup-gradle@ac638b010cf58a27ee6c972d7336334ccaf61c96 |
| 21 | + - name: Run extender tests |
| 22 | + run: ./gradlew server:clean server:test server:jacocoTestReport -PexcludeTags="integration" -i |
| 23 | + - name: Setup .NET Core # Required to execute ReportGenerator |
| 24 | + uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 |
| 25 | + with: |
| 26 | + dotnet-version: 8.x |
| 27 | + dotnet-quality: 'ga' |
| 28 | + - name: ReportGenerator |
| 29 | + uses: danielpalme/ReportGenerator-GitHub-Action@4c0f60daf67483745c34efdeadd4c4e78a19991e3 |
| 30 | + with: |
| 31 | + reports: '${{ github.workspace }}/server/build/reports/jacoco/test/jacocoTestReport.xml' # REQUIRED # The coverage reports that should be parsed (separated by semicolon). Globbing is supported. |
| 32 | + targetdir: 'coveragereport' # REQUIRED # The directory where the generated report should be saved. |
| 33 | + reporttypes: 'HtmlInline;MarkdownSummaryGithub' # The output formats and scope (separated by semicolon) Values: Badges, Clover, Cobertura, OpenCover, CsvSummary, Html, Html_Dark, Html_Light, Html_BlueRed, HtmlChart, HtmlInline, HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlInline_AzurePipelines_Light, HtmlSummary, Html_BlueRed_Summary, JsonSummary, CodeClimate, Latex, LatexSummary, lcov, MarkdownSummary, MarkdownAssembliesSummary, MarkdownSummaryGithub, MarkdownDeltaSummary, MHtml, SvgChart, SonarQube, TeamCitySummary, TextSummary, TextDeltaSummary, Xml, XmlSummary |
| 34 | + sourcedirs: 'server/src/main/java' # Optional directories which contain the corresponding source code (separated by semicolon). The source directories are used if coverage report contains classes without path information. |
| 35 | + # historydir: '' # Optional directory for storing persistent coverage information. Can be used in future reports to show coverage evolution. |
| 36 | + # workingdir: ${{ github.workspace }} # Optional working directory. If available, the targetdir, sourcedirs and historydir are interpreted relative to the working directory (only if not specified as absolute paths). |
| 37 | + # plugins: '' # Optional plugin files for custom reports or custom history storage (separated by semicolon). |
| 38 | + # assemblyfilters: '+*' # Optional list of assemblies that should be included or excluded in the report. Exclusion filters take precedence over inclusion filters. Wildcards are allowed. |
| 39 | + # classfilters: '+*' # Optional list of classes that should be included or excluded in the report. Exclusion filters take precedence over inclusion filters. Wildcards are allowed. |
| 40 | + # filefilters: '+*' # Optional list of files that should be included or excluded in the report. Exclusion filters take precedence over inclusion filters. Wildcards are allowed. |
| 41 | + # riskhotspotassemblyfilters: '+*' # Optional list of assemblies that should be included or excluded in the risk hotspots. Exclusion filters take precedence over inclusion filters. Wildcards are allowed. |
| 42 | + # riskhotspotclassfilters: '+*' # Optional list of classes that should be included or excluded in the risk hotspots. Exclusion filters take precedence over inclusion filters. Wildcards are allowed. |
| 43 | + verbosity: 'Info' # The verbosity level of the log messages. Values: Verbose, Info, Warning, Error, Off |
| 44 | + title: 'Extender code coverage report' # Optional title. |
| 45 | + tag: '${{ github.run_number }}_${{ github.run_id }}' # Optional tag or build version. |
| 46 | + # license: '' # Optional license for PRO version. Get your license here: https://reportgenerator.io/pro |
| 47 | + # customSettings: '' # Optional custom settings (separated by semicolon). See: https://github.com/danielpalme/ReportGenerator/wiki/Settings. |
| 48 | + toolpath: 'reportgeneratortool' # Default directory for installing the dotnet tool. |
| 49 | + - name: Upload test results |
| 50 | + if: always() |
| 51 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 |
| 52 | + with: |
| 53 | + name: test-result |
| 54 | + path: ${{ github.workspace }}/server/build/reports/tests/ |
| 55 | + retention-days: 10 |
| 56 | + - name: Upload coverage report artifact |
| 57 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 |
| 58 | + with: |
| 59 | + name: CoverageReport # Artifact name |
| 60 | + path: coveragereport # Directory containing files to upload |
| 61 | + retention-days: 10 |
| 62 | + - name: Add comment to PR # Only applicable if 'MarkdownSummaryGithub' or one of the other Markdown report types is generated |
| 63 | + if: github.event_name == 'pull_request' |
| 64 | + run: gh pr comment $PR_NUMBER --edit-last --create-if-none --body-file coveragereport/SummaryGithub.md # Adjust path and filename if necessary |
| 65 | + env: |
| 66 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 67 | + PR_NUMBER: ${{ github.event.number }} |
| 68 | + - name: Publish coverage in build summary # Only applicable if 'MarkdownSummaryGithub' or one of the other Markdown report types is generated |
| 69 | + run: cat coveragereport/SummaryGithub.md >> $GITHUB_STEP_SUMMARY # Adjust path and filename if necessary |
| 70 | + shell: bash |
0 commit comments