Skip to content

Add trim lifecycle observability, statistics tracking, and allocation sizing #231

Add trim lifecycle observability, statistics tracking, and allocation sizing

Add trim lifecycle observability, statistics tracking, and allocation sizing #231

Workflow file for this run

name: Java CI with Maven
on:
push:
branches: [ "**" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
# Main code targets Java 1.8; tests target Java 17 (JUnit 6 requires Java 17+).
java-version: [ '17', '21' ]
name: Build with JDK ${{ matrix.java-version }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
cache: maven
- name: Build and test with Maven
run: mvn -B package -Dmaven.javadoc.skip=true --file pom.xml
- name: Upload coverage to Codecov
if: matrix.java-version == '17'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: target/site/jacoco/jacoco.xml
continue-on-error: true
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
mutation-testing:
runs-on: ubuntu-latest
name: Mutation Testing with PIT
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Run mutation tests with PIT
run: mvn -B test-compile org.pitest:pitest-maven:mutationCoverage -Dmaven.javadoc.skip=true --file pom.xml
- name: Extract Pitest Survivors with Context
if: always()
run: |
echo "=== PIT Survived Mutations ==="
echo ""
# Loop through all HTML files in pit-reports
for html_file in $(find target/pit-reports -name "*.html" -type f | sort); do
echo "Processing: $html_file"
# Extract lines containing SURVIVED with context (2 before, 3 after)
if grep -q "SURVIVED" "$html_file"; then
echo "Found survivors in $html_file:"
grep -B 2 -A 3 "SURVIVED" "$html_file"
echo ""
fi
done
echo "=== Count unique survivors ==="
echo "Check the 'Found survivors' sections above - each unique location with SURVIVED is one uncovered mutation"
- name: Upload PIT report
if: always()
uses: actions/upload-artifact@v4
with:
name: pit-reports
path: target/pit-reports/