| name: Java Coverage |
| on: |
| pull_request: |
| types: [opened, reopened, synchronize] |
| paths: |
| - 'java/**' |
| push: |
| branches: |
| - master |
| # mainly refer to: https://github.com/merkrafter/Merkompiler/blob/development/.github/workflows/quality_assurance.yml |
| jobs: |
| calculate-coverage: |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@master |
| - name: Set up JDK 11 |
| uses: actions/setup-java@v2 |
| with: |
| java-version: "11" |
| distribution: "adopt" |
| - name: Generate coverage report |
| run: mvn test --file ./java/pom.xml |
| - name: Test summary |
| uses: test-summary/action@v1 |
| with: |
| paths: "**/TEST-*.xml" |
| if: always() |
| - name: Upload to Codecov |
| uses: codecov/codecov-action@v3 |
| with: |
| flags: java |
| fail_ci_if_error: true |
| verbose: true |