michael-nmg/java-project-71

View on GitHub
.github/workflows/java-ci.yml

Summary

Maintainability
Test Coverage
name: Java CI

on:
  - push
  - pull_request

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3

      - name: Setup Java 20
        uses: actions/setup-java@v3
        with:
          java-version: '20'
          distribution: 'temurin'

      - name: Gradle
        uses: gradle/gradle-build-action@v2
        with:
          gradle-version: 8.3

      - name: Checkstyle, build and tests
        working-directory: app
        run: |
          make checkstyle
          make build

      - name: Publish code coverage
        uses: paambaati/codeclimate-action@v5.0.0
        env:
          CC_TEST_REPORTER_ID: ${{secrets.TEST_REPORTER_ID}}
          JACOCO_SOURCE_PATH: "${{github.workspace}}/app/src/main/java"
        with:
          workingDirectory: app
          coverageCommand: make report
          coverageLocations: ${{github.workspace}}/app/build/reports/jacoco/test/jacocoTestReport.xml:jacoco