|
| 1 | +name: JaCoCo Report |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: [ master ] |
| 6 | + types: [ opened, edited, synchronize, reopened ] |
| 7 | + |
| 8 | +env: |
| 9 | + scalaLong: 2.13.11 |
| 10 | + scalaShort: "2.13" |
| 11 | + coverage-overall: 80.0 |
| 12 | + coverage-changed-files: 80.0 |
| 13 | + coverage-per-changed-file: 0.0 |
| 14 | + check-overall-coverages: true |
| 15 | + MODULES: | |
| 16 | + statusboard-model: model |
| 17 | + statusboard-repository: repository |
| 18 | + statusboard-utils: utils |
| 19 | + statusboard-providers: providers |
| 20 | + statusboard-checker: checker |
| 21 | + statusboard-api-controllers: api/controllers |
| 22 | + statusboard-notification-actioners: notification/actioners |
| 23 | + statusboard-notification-deciders: notification/deciders |
| 24 | + statusboard-monitoring: monitoring |
| 25 | + statusboard-notification: notification |
| 26 | + MODULES_THRESHOLDS: | |
| 27 | + statusboard-model: 35*80* |
| 28 | + statusboard-repository: 35*80* |
| 29 | + statusboard-utils: 35*80* |
| 30 | + statusboard-providers: 35*80* |
| 31 | + statusboard-checker: 35*80* |
| 32 | + statusboard-api-controllers: 35*80* |
| 33 | + statusboard-notification-actioners: 35*80* |
| 34 | + statusboard-notification-deciders: 35*80* |
| 35 | + statusboard-monitoring: 35*80* |
| 36 | + statusboard-notification: 35*80* |
| 37 | +
|
| 38 | +jobs: |
| 39 | + jacoco-report: |
| 40 | + name: JaCoCo Report |
| 41 | + runs-on: ubuntu-latest |
| 42 | + |
| 43 | + steps: |
| 44 | + - name: Checkout code |
| 45 | + id: code-checkout |
| 46 | + uses: actions/checkout@v4 |
| 47 | + with: |
| 48 | + persist-credentials: false |
| 49 | + |
| 50 | + - name: Setup JVM and SBT |
| 51 | + id: jvm-setup |
| 52 | + |
| 53 | + with: |
| 54 | + jvm: corretto:21.0.2.13.1 |
| 55 | + apps: sbt |
| 56 | + |
| 57 | + - name: Build and run tests with test coverage |
| 58 | + id: jacoco-run |
| 59 | + continue-on-error: true |
| 60 | + run: sbt jacoco |
| 61 | + env: |
| 62 | + AWS_REGION: "ignored" |
| 63 | + AWS_ACCESS_KEY_ID: "ignored" |
| 64 | + AWS_SECRET_ACCESS_KEY: "ignored" |
| 65 | + |
| 66 | + - name: Publish JaCoCo Report in PR comments |
| 67 | + id: jacoco |
| 68 | + uses: MoranaApps/jacoco-report@v2 |
| 69 | + with: |
| 70 | + token: '${{ secrets.GITHUB_TOKEN }}' |
| 71 | + paths: | |
| 72 | + **/target/**/jacoco/report/jacoco.xml |
| 73 | + exclude-paths: | |
| 74 | + database/target/** |
| 75 | + sensitivity: "detail" |
| 76 | + comment-mode: 'multi' |
| 77 | + min-coverage-overall: ${{ env.coverage-overall }} |
| 78 | + min-coverage-changed-files: ${{ env.coverage-changed-files }} |
| 79 | + min-coverage-per-changed-file: ${{ env.coverage-per-changed-file }} |
| 80 | + skip-unchanged: false |
| 81 | + modules: ${{ env.MODULES }} |
| 82 | + modules-thresholds: ${{ env.MODULES_THRESHOLDS }} |
| 83 | + |
| 84 | + jacoco-report-server: |
| 85 | + name: JaCoCo Report on Server |
| 86 | + runs-on: ubuntu-latest |
| 87 | + services: |
| 88 | + dynamodb-local: |
| 89 | + image: "amazon/dynamodb-local:latest" |
| 90 | + ports: |
| 91 | + - "8000:8000" |
| 92 | + steps: |
| 93 | + - name: Checkout code |
| 94 | + id: code-checkout |
| 95 | + uses: actions/checkout@v4 |
| 96 | + with: |
| 97 | + persist-credentials: false |
| 98 | + |
| 99 | + - name: Setup JVM and SBT |
| 100 | + id: jvm-setup |
| 101 | + |
| 102 | + with: |
| 103 | + jvm: corretto:21.0.2.13.1 |
| 104 | + apps: sbt |
| 105 | + |
| 106 | + - name: Build and run tests with test coverage |
| 107 | + id: jacoco-run |
| 108 | + continue-on-error: true |
| 109 | + run: sbt jacoco |
| 110 | + env: |
| 111 | + AWS_REGION: "ignored" |
| 112 | + AWS_ACCESS_KEY_ID: "ignored" |
| 113 | + AWS_SECRET_ACCESS_KEY: "ignored" |
| 114 | + |
| 115 | + - name: Check coverage thresholds and add reports in PR comments |
| 116 | + id: jacoco-report |
| 117 | + uses: MoranaApps/jacoco-report@v2 |
| 118 | + with: |
| 119 | + token: '${{ secrets.GITHUB_TOKEN }}' |
| 120 | + paths: | |
| 121 | + **/target/**/jacoco/report/jacoco.xml |
| 122 | + exclude-paths: | |
| 123 | + database/target/** |
| 124 | + sensitivity: "detail" |
| 125 | + comment-mode: 'multi' |
| 126 | + min-coverage-overall: ${{ env.coverage-overall }} |
| 127 | + min-coverage-changed-files: ${{ env.coverage-changed-files }} |
| 128 | + min-coverage-per-changed-file: ${{ env.coverage-per-changed-file }} |
| 129 | + skip-unchanged: false |
| 130 | + modules: ${{ env.MODULES }} |
| 131 | + modules-thresholds: ${{ env.MODULES_THRESHOLDS }} |
0 commit comments