Skip to content

Merge pull request #118 from jacomago/update-depends #21

Merge pull request #118 from jacomago/update-depends

Merge pull request #118 from jacomago/update-depends #21

Workflow file for this run

# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Code coverage
on:
push:
branches: [ "master" ]
pull_request:
jobs:
codecov:
permissions:
checks: write
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- uses: ankane/setup-elasticsearch@v1
with:
elasticsearch-version: 8
config: |
http.port: 9200
- name: Clear existing docker image cache
shell: bash
run: docker image prune -af
- name: Integration Test with Maven
run: mvn clean install test-compile failsafe:integration-test failsafe:verify verify --batch-mode --fail-at-end -Djacoco.skip=false -DskipITs=false -DskipITCoverage=false
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: success() || failure() # always run even if the previous step fails
with:
report_paths: '**/target/failsafe-reports/TEST-*.xml'
- name: Add coverage to PR
id: jacoco
uses: madrapps/jacoco-report@v1.6.1
with:
paths: |
${{ github.workspace }}/**/target/site/jacoco/jacoco.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 40
min-coverage-changed-files: 60
- name: Upload Code Coverage Artifacts
uses: actions/upload-artifact@v3
if: success() || failure() # always run even if the previous step fails
with:
name: code-coverage-reports
path: ${{ github.workspace }}/**/target/site/jacoco
- name: Get the Coverage info
run: |
echo "Total coverage ${{ steps.jacoco.outputs.coverage-overall }}"
echo "Changed Files coverage ${{ steps.jacoco.outputs.coverage-changed-files }}"