|
49 | 49 | path: target/site/jacoco/jacoco.xml |
50 | 50 | if-no-files-found: ignore |
51 | 51 |
|
| 52 | + report: |
| 53 | + name: Report |
| 54 | + needs: [test] |
| 55 | + runs-on: ubuntu-latest |
| 56 | + permissions: |
| 57 | + contents: write |
| 58 | + steps: |
| 59 | + - uses: actions/checkout@v6 |
| 60 | + - uses: actions/setup-java@v5 |
| 61 | + with: { java-version: '17', distribution: temurin, cache: maven } |
| 62 | + - uses: actions/download-artifact@v8 |
| 63 | + with: { name: jacoco-report, path: target/site/jacoco/ } |
| 64 | + continue-on-error: true |
| 65 | + - uses: advanced-security/maven-dependency-submission-action@v5 |
| 66 | + - name: Coveralls |
| 67 | + uses: coverallsapp/github-action@v2 |
| 68 | + with: |
| 69 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 70 | + file: target/site/jacoco/jacoco.xml |
| 71 | + format: jacoco |
| 72 | + continue-on-error: true |
| 73 | + - name: Codecov |
| 74 | + uses: codecov/codecov-action@v6 |
| 75 | + with: |
| 76 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 77 | + files: target/site/jacoco/jacoco.xml |
| 78 | + continue-on-error: true |
| 79 | + - name: Run PIT mutation tests |
| 80 | + run: mvn --batch-mode test-compile org.pitest:pitest-maven:mutationCoverage -Dmaven.javadoc.skip=true |
| 81 | + - name: Extract PIT survivors |
| 82 | + if: always() |
| 83 | + run: | |
| 84 | + echo "=== PIT Survived Mutations ===" |
| 85 | + for html_file in $(find target/pit-reports -name "*.html" -type f | sort); do |
| 86 | + if grep -q "SURVIVED" "$html_file"; then |
| 87 | + echo "Found survivors in $html_file:" |
| 88 | + grep -B 2 -A 3 "SURVIVED" "$html_file" |
| 89 | + echo "" |
| 90 | + fi |
| 91 | + done |
| 92 | + - uses: actions/upload-artifact@v7 |
| 93 | + if: always() |
| 94 | + with: { name: pit-reports, path: target/pit-reports/ } |
| 95 | + - name: Run JMH benchmarks |
| 96 | + run: > |
| 97 | + mvn --batch-mode exec:java |
| 98 | + -Dexec.mainClass=org.openjdk.jmh.Main |
| 99 | + -Dexec.classpathScope=test |
| 100 | + -Dexec.args="StreamBufferThroughputBenchmark -wi 2 -i 3 -f 0 -rf json -rff target/jmh-results.json" |
| 101 | + -Dmaven.javadoc.skip=true |
| 102 | + continue-on-error: true |
| 103 | + - uses: actions/upload-artifact@v7 |
| 104 | + if: always() |
| 105 | + with: { name: jmh-results, path: target/jmh-results.json } |
| 106 | + |
52 | 107 | publish-snapshot: |
53 | 108 | name: Publish Snapshot to Central |
54 | | - needs: [test] |
| 109 | + needs: [report] |
55 | 110 | if: >- |
56 | 111 | (github.event_name == 'push' && github.ref == 'refs/heads/main') || |
57 | 112 | github.event_name == 'workflow_dispatch' |
|
75 | 130 |
|
76 | 131 | publish-release: |
77 | 132 | name: Publish Release to Central |
78 | | - needs: [test] |
| 133 | + needs: [report] |
79 | 134 | if: startsWith(github.ref, 'refs/tags/v') |
80 | 135 | runs-on: ubuntu-latest |
81 | 136 | environment: maven-central |
@@ -114,63 +169,3 @@ jobs: |
114 | 169 | uses: softprops/action-gh-release@v2 |
115 | 170 | with: |
116 | 171 | files: release-assets/* |
117 | | - |
118 | | - post-publish: |
119 | | - name: Post-Publish |
120 | | - needs: [test, publish-snapshot, publish-release] |
121 | | - if: >- |
122 | | - always() && |
123 | | - needs.test.result == 'success' && |
124 | | - (needs.publish-snapshot.result == 'success' || |
125 | | - needs.publish-release.result == 'success') |
126 | | - runs-on: ubuntu-latest |
127 | | - permissions: |
128 | | - contents: write |
129 | | - steps: |
130 | | - - uses: actions/checkout@v6 |
131 | | - - uses: actions/setup-java@v5 |
132 | | - with: { java-version: '17', distribution: temurin, cache: maven } |
133 | | - - uses: actions/download-artifact@v8 |
134 | | - with: { name: jacoco-report, path: target/site/jacoco/ } |
135 | | - continue-on-error: true |
136 | | - - uses: advanced-security/maven-dependency-submission-action@v5 |
137 | | - - name: Upload coverage to Codecov |
138 | | - uses: codecov/codecov-action@v6 |
139 | | - with: |
140 | | - token: ${{ secrets.CODECOV_TOKEN }} |
141 | | - files: target/site/jacoco/jacoco.xml |
142 | | - continue-on-error: true |
143 | | - - name: Coveralls |
144 | | - uses: coverallsapp/github-action@v2 |
145 | | - with: |
146 | | - github-token: ${{ secrets.GITHUB_TOKEN }} |
147 | | - file: target/site/jacoco/jacoco.xml |
148 | | - format: jacoco |
149 | | - continue-on-error: true |
150 | | - - name: Run PIT mutation tests |
151 | | - run: mvn --batch-mode test-compile org.pitest:pitest-maven:mutationCoverage -Dmaven.javadoc.skip=true |
152 | | - - name: Extract PIT survivors |
153 | | - if: always() |
154 | | - run: | |
155 | | - echo "=== PIT Survived Mutations ===" |
156 | | - for html_file in $(find target/pit-reports -name "*.html" -type f | sort); do |
157 | | - if grep -q "SURVIVED" "$html_file"; then |
158 | | - echo "Found survivors in $html_file:" |
159 | | - grep -B 2 -A 3 "SURVIVED" "$html_file" |
160 | | - echo "" |
161 | | - fi |
162 | | - done |
163 | | - - uses: actions/upload-artifact@v7 |
164 | | - if: always() |
165 | | - with: { name: pit-reports, path: target/pit-reports/ } |
166 | | - - name: Run JMH benchmarks |
167 | | - run: > |
168 | | - mvn --batch-mode exec:java |
169 | | - -Dexec.mainClass=org.openjdk.jmh.Main |
170 | | - -Dexec.classpathScope=test |
171 | | - -Dexec.args="StreamBufferThroughputBenchmark -wi 2 -i 3 -f 0 -rf json -rff target/jmh-results.json" |
172 | | - -Dmaven.javadoc.skip=true |
173 | | - continue-on-error: true |
174 | | - - uses: actions/upload-artifact@v7 |
175 | | - if: always() |
176 | | - with: { name: jmh-results, path: target/jmh-results.json } |
0 commit comments