Skip to content

Add codecov config #351

Add codecov config

Add codecov config #351

Workflow file for this run

# This workflow will build the project on pull requests with tests
# Uses:
# OS: ubuntu-latest
# JDK: Adopt JDK 21
name: PR Builder
on:
pull_request:
branches: [4.12.x]
workflow_dispatch:
# Cancel in-progress runs when a new run is triggered for the same PR
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
MAVEN_OPTS: -Xmx4g -Xms1g
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Adopt JDK 21
uses: actions/setup-java@v2
with:
java-version: "21"
distribution: "adopt"
- name: Cache local Maven repository
id: cache-maven-m2
uses: actions/cache@v3
env:
cache-name: cache-m2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-${{ env.cache-name }}-
${{ runner.os }}-maven-
${{ runner.os }}-
- name: Build with Maven
run: mvn clean install -U -B
- name: Delete SNAPSHOT artifacts
run: find ~/.m2/repository/ -name "*-SNAPSHOT" -type d -print -prune -exec rm -r {} +
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: "**/target/coverage-reports/site/jacoco-aggregate/jacoco.xml"
flags: unit