Skip to content

Upgrade sbt-ci-release #82

Upgrade sbt-ci-release

Upgrade sbt-ci-release #82

name: CI check JaCoCo code-coverage
on:
pull_request:
branches: [ main ]
jobs:
code_coverage:
name: CI check JaCoCo code-coverage
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Setup Scala
uses: olafurpg/setup-scala@v14
with:
java-version: "[email protected]"
- name: Build, run tests, and generate Jacoco code coverage report for springdoc-openapi-scala (all subversions)
run: sbt jacoco
- name: Add coverage to PR for springdoc-openapi-scala-1
id: jacoco1
uses: madrapps/[email protected]
with:
paths: >
${{ github.workspace }}/library/target/1-jvm-2.12/jacoco/report/jacoco.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 0.0
min-coverage-changed-files: 80.0
title: JaCoCo code coverage report - springdoc-openapi-scala-1
update-comment: true
debug-mode: true
- name: Add coverage to PR for springdoc-openapi-scala-2
id: jacoco2
uses: madrapps/[email protected]
with:
paths: >
${{ github.workspace }}/library/target/2-jvm-2.12/jacoco/report/jacoco.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 0.0
min-coverage-changed-files: 80.0
title: JaCoCo code coverage report - springdoc-openapi-scala-2
update-comment: true
debug-mode: true
- name: Get the Coverage info for springdoc-openapi-scala-1
run: |
echo "Total coverage ${{ steps.jacoco1.outputs.coverage-overall }}"
echo "Changed Files coverage ${{ steps.jacoco1.outputs.coverage-changed-files }}"
- name: Get the Coverage info for springdoc-openapi-scala-2
run: |
echo "Total coverage ${{ steps.jacoco2.outputs.coverage-overall }}"
echo "Changed Files coverage ${{ steps.jacoco2.outputs.coverage-changed-files }}"
- name: Fail PR if changed files coverage is less than 80% for springdoc-openapi-scala-1
if: ${{ steps.jacoco1.outputs.coverage-changed-files < 80.0 }}
uses: actions/[email protected]
with:
script: |
core.setFailed('Changed files coverage is less than 80%!')
- name: Fail PR if changed files coverage is less than 80% for springdoc-openapi-scala-2
if: ${{ steps.jacoco2.outputs.coverage-changed-files < 80.0 }}
uses: actions/[email protected]
with:
script: |
core.setFailed('Changed files coverage is less than 80%!')