Skip to content

Commit 60fddfc

Browse files
committed
Integrate Codecov coverage uploads
1 parent f139ff9 commit 60fddfc

4 files changed

Lines changed: 209 additions & 190 deletions

File tree

.github/workflows/ci.yml

Lines changed: 148 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CI
22

33
on:
44
push:
5-
branches: [ main, master, develop ]
5+
branches: [main, master, develop]
66
pull_request:
7-
branches: [ main, master, develop ]
7+
branches: [main, master, develop]
88
workflow_dispatch:
99

1010
jobs:
@@ -14,165 +14,174 @@ jobs:
1414
strategy:
1515
matrix:
1616
java: [21, 22]
17-
17+
1818
steps:
19-
- name: Checkout code
20-
uses: actions/checkout@v5
21-
22-
- name: Set up JDK ${{ matrix.java }}
23-
uses: actions/setup-java@v5
24-
with:
25-
java-version: ${{ matrix.java }}
26-
distribution: 'temurin'
27-
cache: maven
28-
29-
- name: Verify Maven configuration
30-
run: mvn help:effective-settings
31-
32-
- name: Run tests with coverage
33-
run: mvn clean test jacoco:report
34-
35-
- name: Generate test report
36-
uses: dorny/test-reporter@v2
37-
if: success() || failure()
38-
with:
39-
name: JDK ${{ matrix.java }} Tests
40-
path: target/surefire-reports/*.xml
41-
reporter: java-junit
42-
fail-on-error: false
19+
- name: Checkout code
20+
uses: actions/checkout@v5
21+
22+
- name: Set up JDK ${{ matrix.java }}
23+
uses: actions/setup-java@v5
24+
with:
25+
java-version: ${{ matrix.java }}
26+
distribution: "temurin"
27+
cache: maven
28+
29+
- name: Verify Maven configuration
30+
run: mvn help:effective-settings
31+
32+
- name: Run tests with coverage
33+
run: mvn clean test jacoco:report
34+
35+
- name: Generate test report
36+
uses: dorny/test-reporter@v2
37+
if: success() || failure()
38+
with:
39+
name: JDK ${{ matrix.java }} Tests
40+
path: target/surefire-reports/*.xml
41+
reporter: java-junit
42+
fail-on-error: false
43+
44+
- name: Upload coverage reports to Codecov
45+
if: matrix.java == '21'
46+
uses: codecov/codecov-action@v5
47+
with:
48+
token: ${{ secrets.CODECOV_TOKEN }}
49+
file: ./target/site/jacoco/jacoco.xml
50+
fail_ci_if_error: false
51+
verbose: true
4352

4453
build:
4554
name: Build and Verify
4655
runs-on: ubuntu-latest
4756
needs: test
48-
57+
4958
steps:
50-
- name: Checkout code
51-
uses: actions/checkout@v5
52-
53-
- name: Set up JDK 21
54-
uses: actions/setup-java@v5
55-
with:
56-
java-version: 21
57-
distribution: 'temurin'
58-
cache: maven
59-
60-
- name: Compile and package
61-
run: mvn clean compile package
62-
63-
- name: Verify JAR creation
64-
run: |
65-
ls -la target/
66-
if [ ! -f target/inqwise-async-*.jar ]; then
67-
echo "JAR file not found!"
68-
exit 1
69-
fi
70-
71-
- name: Generate Javadoc
72-
run: mvn javadoc:javadoc
73-
74-
- name: Upload build artifacts
75-
uses: actions/upload-artifact@v4
76-
with:
77-
name: maven-artifacts
78-
path: |
79-
target/*.jar
80-
target/site/apidocs/
81-
retention-days: 30
59+
- name: Checkout code
60+
uses: actions/checkout@v5
61+
62+
- name: Set up JDK 21
63+
uses: actions/setup-java@v5
64+
with:
65+
java-version: 21
66+
distribution: "temurin"
67+
cache: maven
68+
69+
- name: Compile and package
70+
run: mvn clean compile package
71+
72+
- name: Verify JAR creation
73+
run: |
74+
ls -la target/
75+
if [ ! -f target/inqwise-async-*.jar ]; then
76+
echo "JAR file not found!"
77+
exit 1
78+
fi
79+
80+
- name: Generate Javadoc
81+
run: mvn javadoc:javadoc
82+
83+
- name: Upload build artifacts
84+
uses: actions/upload-artifact@v4
85+
with:
86+
name: maven-artifacts
87+
path: |
88+
target/*.jar
89+
target/site/apidocs/
90+
retention-days: 30
8291

8392
code-quality:
8493
name: Code Quality
8594
runs-on: ubuntu-latest
86-
95+
8796
steps:
88-
- name: Checkout code
89-
uses: actions/checkout@v5
90-
91-
- name: Set up JDK 21
92-
uses: actions/setup-java@v5
93-
with:
94-
java-version: 21
95-
distribution: 'temurin'
96-
cache: maven
97-
98-
- name: Run dependency check
99-
run: mvn dependency:analyze
100-
101-
- name: Check for security vulnerabilities
102-
run: mvn dependency:tree
103-
104-
- name: Validate Maven project
105-
run: mvn validate
106-
107-
- name: Security scan info
108-
run: |
109-
echo "🔒 Security scanning available via dedicated Snyk workflow"
110-
echo " - On pull requests and releases"
111-
echo " - Monthly scheduled scans"
112-
echo " - Manual dispatch available"
113-
echo "💡 This optimizes free tier usage while maintaining security coverage"
114-
echo "⚙️ Configure SNYK_TOKEN in repository secrets to enable scanning"
97+
- name: Checkout code
98+
uses: actions/checkout@v5
99+
100+
- name: Set up JDK 21
101+
uses: actions/setup-java@v5
102+
with:
103+
java-version: 21
104+
distribution: "temurin"
105+
cache: maven
106+
107+
- name: Run dependency check
108+
run: mvn dependency:analyze
109+
110+
- name: Check for security vulnerabilities
111+
run: mvn dependency:tree
112+
113+
- name: Validate Maven project
114+
run: mvn validate
115+
116+
- name: Security scan info
117+
run: |
118+
echo "🔒 Security scanning available via dedicated Snyk workflow"
119+
echo " - On pull requests and releases"
120+
echo " - Monthly scheduled scans"
121+
echo " - Manual dispatch available"
122+
echo "💡 This optimizes free tier usage while maintaining security coverage"
123+
echo "⚙️ Configure SNYK_TOKEN in repository secrets to enable scanning"
115124
116125
integration-test:
117126
name: Integration Tests
118127
runs-on: ubuntu-latest
119128
needs: build
120-
129+
121130
steps:
122-
- name: Checkout code
123-
uses: actions/checkout@v5
124-
125-
- name: Set up JDK 21
126-
uses: actions/setup-java@v5
127-
with:
128-
java-version: 21
129-
distribution: 'temurin'
130-
cache: maven
131-
132-
- name: Run integration tests with coverage
133-
run: mvn clean verify jacoco:report
134-
135-
- name: Test RFC compliance
136-
run: mvn test -Dtest=RFC*
137-
138-
- name: Test Stream compatibility
139-
run: mvn test -Dtest=*Compatibility*
140-
141-
- name: Upload coverage reports
142-
uses: codecov/codecov-action@v5
143-
with:
144-
file: target/site/jacoco/jacoco.xml
145-
flags: unittests
146-
name: codecov-umbrella
147-
fail_ci_if_error: false
131+
- name: Checkout code
132+
uses: actions/checkout@v5
133+
134+
- name: Set up JDK 21
135+
uses: actions/setup-java@v5
136+
with:
137+
java-version: 21
138+
distribution: "temurin"
139+
cache: maven
140+
141+
- name: Run integration tests with coverage
142+
run: mvn clean verify jacoco:report
143+
144+
- name: Test RFC compliance
145+
run: mvn test -Dtest=RFC*
146+
147+
- name: Test Stream compatibility
148+
run: mvn test -Dtest=*Compatibility*
149+
150+
- name: Upload coverage reports
151+
uses: codecov/codecov-action@v5
152+
with:
153+
file: target/site/jacoco/jacoco.xml
154+
flags: unittests
155+
name: codecov-umbrella
156+
fail_ci_if_error: false
148157

149158
release-check:
150159
name: Release Readiness
151160
runs-on: ubuntu-latest
152161
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
153162
needs: [test, build, code-quality, integration-test]
154-
163+
155164
steps:
156-
- name: Checkout code
157-
uses: actions/checkout@v5
158-
159-
- name: Set up JDK 21
160-
uses: actions/setup-java@v5
161-
with:
162-
java-version: 21
163-
distribution: 'temurin'
164-
cache: maven
165-
166-
- name: Check if ready for release
167-
run: |
168-
mvn clean package -DskipTests
169-
mvn source:jar javadoc:jar
170-
echo "✅ Release artifacts can be generated successfully"
171-
172-
- name: Validate release profile
173-
run: |
174-
if mvn help:all-profiles | grep -q "sonatype-oss-release"; then
175-
echo "✅ Release profile found"
176-
else
177-
echo "⚠️ Release profile not found - manual release process required"
178-
fi
165+
- name: Checkout code
166+
uses: actions/checkout@v5
167+
168+
- name: Set up JDK 21
169+
uses: actions/setup-java@v5
170+
with:
171+
java-version: 21
172+
distribution: "temurin"
173+
cache: maven
174+
175+
- name: Check if ready for release
176+
run: |
177+
mvn clean package -DskipTests
178+
mvn source:jar javadoc:jar
179+
echo "✅ Release artifacts can be generated successfully"
180+
181+
- name: Validate release profile
182+
run: |
183+
if mvn help:all-profiles | grep -q "sonatype-oss-release"; then
184+
echo "✅ Release profile found"
185+
else
186+
echo "⚠️ Release profile not found - manual release process required"
187+
fi

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
[![CI](https://github.com/inqwise/inqwise-async/actions/workflows/ci.yml/badge.svg)](https://github.com/inqwise/inqwise-async/actions/workflows/ci.yml)
44
[![Release](https://github.com/inqwise/inqwise-async/actions/workflows/release.yml/badge.svg)](https://github.com/inqwise/inqwise-async/actions/workflows/release.yml)
55
[![CodeQL](https://github.com/inqwise/inqwise-async/actions/workflows/codeql.yml/badge.svg)](https://github.com/inqwise/inqwise-async/actions/workflows/codeql.yml)
6+
[![Codecov](https://codecov.io/gh/inqwise/inqwise-async/branch/master/graph/badge.svg)](https://codecov.io/gh/inqwise/inqwise-async)
67
[![Snyk Security](https://github.com/inqwise/inqwise-async/actions/workflows/snyk.yml/badge.svg)](https://github.com/inqwise/inqwise-async/actions/workflows/snyk.yml)
78
[![Maven Central](https://img.shields.io/maven-central/v/com.inqwise/inqwise-async.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.inqwise%22%20AND%20a:%22inqwise-async%22)
89
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
910
[![Java Version](https://img.shields.io/badge/Java-21%2B-blue.svg)](https://openjdk.java.net/projects/jdk/21/)
10-
[![Coverage](https://img.shields.io/badge/Coverage-77.7%25-yellow.svg)]()
1111
[![Vert.x](https://img.shields.io/badge/Vert.x-5.0.4%2B-purple.svg)](https://vertx.io/)
1212
Inqwise Async bridges standard Java blocking I/O structures with Vert.x's asynchronous, non-blocking APIs. By providing robust wrappers for traditional Java classes such as {@link java.io.InputStream}, {@link java.io.OutputStream}, {@link java.io.Reader}, {@link java.io.Writer}, and more, Inqwise Async enables developers to integrate existing Java codebases into Vert.x-based reactive applications without disrupting the event loop. This bridge ensures efficient and scalable I/O operations by managing back-pressure and flow control, facilitating the modernization of legacy systems for high-performance, event-driven environments.
1313

@@ -179,4 +179,4 @@ This project is licensed under the [MIT License](LICENSE).
179179

180180
---
181181

182-
If you have any questions or need further assistance, feel free to open an issue or contact the maintainers.
182+
If you have any questions or need further assistance, feel free to open an issue or contact the maintainers.

codecov.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
codecov:
2+
require_ci_to_pass: yes
3+
4+
coverage:
5+
precision: 2
6+
round: down
7+
range: "70...100"
8+
9+
status:
10+
project:
11+
default:
12+
target: 75%
13+
threshold: 1%
14+
if_not_found: success
15+
patch:
16+
default:
17+
target: 70%
18+
threshold: 2%
19+
20+
ignore:
21+
- "src/test/**"
22+
- "src/main/**/example/**"
23+
- "**/*Test.java"
24+
- "**/*TestUtils.java"
25+
26+
comment:
27+
layout: "reach,diff,flags,tree"
28+
behavior: default
29+
require_changes: no

0 commit comments

Comments
 (0)