SierraSystems/ntt-data-notification-service

View on GitHub
.github/workflows/jacoco-coverage.yml

Summary

Maintainability
Test Coverage
name: Maven Test

on: [push]
      
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - name: Set up JDK 1.8
      uses: actions/setup-java@v1
      with:
        java-version: 1.8
    - name: Set up m2 cache
      uses: actions/cache@v1
      with:
        path: ~/.m2/repository
        key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
        restore-keys: |
          ${{ runner.os }}-maven-
    - name: Run javascript tests
      uses: actions/checkout@master
    - uses: actions/setup-node@master
      with:
        node-version: "12"
    - run: npm install
    - run: npm test
    - name: Test & publish code coverage
      uses: paambaati/codeclimate-action@v2.6.0
      env:
        # Set CC_TEST_REPORTER_ID as secret of your repo
        CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
        JACOCO_SOURCE_PATH: "${{github.workspace}}/src/main/java"
      with:
        # The report file must be there, otherwise Code Climate won't find it
        coverageCommand: mvn -B test --file pom.xml
        coverageLocations: |
          ${{github.workspace}}/target/site/jacoco/jacoco.xml:jacoco
          ${{github.workspace}}/coverage/lcov.info:lcov