Skip to content

Commit d6a6534

Browse files
MoshPeclaude
andcommitted
ci: add CodeQL, OWASP dependency-check, JaCoCo coverage, and README badges
- CodeQL SAST on push/PR/weekly schedule - OWASP dependency-check on push/weekly, uploads SARIF to Security tab - JaCoCo coverage report wired into CI verify phase - Codecov upload step in CI workflow - README badges: CI, CodeQL, Codecov, Maven Central, License Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 8d640e1 commit d6a6534

6 files changed

Lines changed: 139 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,10 @@ jobs:
2626
--no-transfer-progress \
2727
clean verify \
2828
-Dgpg.skip=true
29+
30+
- name: Upload coverage to Codecov
31+
uses: codecov/codecov-action@v5
32+
with:
33+
files: streamfence-core/target/site/jacoco/jacoco.xml
34+
flags: unittests
35+
fail_ci_if_error: false

.github/workflows/codeql.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
- cron: '23 7 * * 1'
10+
11+
jobs:
12+
analyze:
13+
name: Analyze (Java)
14+
runs-on: ubuntu-latest
15+
permissions:
16+
security-events: write
17+
actions: read
18+
contents: read
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Java 25
25+
uses: actions/setup-java@v4
26+
with:
27+
java-version: '25'
28+
distribution: 'temurin'
29+
30+
- name: Initialize CodeQL
31+
uses: github/codeql-action/init@v3
32+
with:
33+
languages: java
34+
queries: security-and-quality
35+
36+
- name: Build
37+
run: |
38+
mvn -pl streamfence-core \
39+
--no-transfer-progress \
40+
clean compile \
41+
-Dgpg.skip=true
42+
43+
- name: Perform CodeQL Analysis
44+
uses: github/codeql-action/analyze@v3
45+
with:
46+
category: /language:java
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Dependency Check
2+
3+
on:
4+
push:
5+
branches: [main]
6+
schedule:
7+
- cron: '41 6 * * 1'
8+
9+
jobs:
10+
owasp:
11+
name: OWASP Dependency Check
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
security-events: write
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Java 25
22+
uses: actions/setup-java@v4
23+
with:
24+
java-version: '25'
25+
distribution: 'temurin'
26+
27+
- name: Run OWASP Dependency Check
28+
run: |
29+
mvn -pl streamfence-core \
30+
--no-transfer-progress \
31+
org.owasp:dependency-check-maven:check \
32+
-Dgpg.skip=true \
33+
-DfailBuildOnCVSS=7 \
34+
-DsuppressionFile=.github/dependency-check-suppressions.xml \
35+
-Dformats=HTML,SARIF \
36+
-DoutputDirectory=target/dependency-check
37+
continue-on-error: true
38+
39+
- name: Upload SARIF report
40+
uses: github/codeql-action/upload-sarif@v3
41+
if: always()
42+
with:
43+
sarif_file: streamfence-core/target/dependency-check/dependency-check-report.sarif
44+
category: dependency-check
45+
46+
- name: Upload HTML report
47+
uses: actions/upload-artifact@v4
48+
if: always()
49+
with:
50+
name: dependency-check-report
51+
path: streamfence-core/target/dependency-check/dependency-check-report.html
52+
retention-days: 30

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# StreamFence - Embeddable Java Socket.IO Server Library
22

3+
[![CI](https://github.com/MoshPe/StreamFence/actions/workflows/ci.yml/badge.svg)](https://github.com/MoshPe/StreamFence/actions/workflows/ci.yml)
4+
[![CodeQL](https://github.com/MoshPe/StreamFence/actions/workflows/codeql.yml/badge.svg)](https://github.com/MoshPe/StreamFence/actions/workflows/codeql.yml)
5+
[![codecov](https://codecov.io/gh/MoshPe/StreamFence/branch/main/graph/badge.svg)](https://codecov.io/gh/MoshPe/StreamFence)
6+
[![Maven Central](https://img.shields.io/maven-central/v/io.github.moshpe/streamfence-core.svg)](https://central.sonatype.com/artifact/io.github.moshpe/streamfence-core)
7+
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
8+
39
## Why StreamFence
410

511
`StreamFence` is an embeddable Java Socket.IO server library built on `netty-socketio` for teams that need live topic delivery with bounded memory, explicit backpressure behavior, and optional reliable delivery.

pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
<maven.source.version>3.3.1</maven.source.version>
5656
<maven.javadoc.version>3.11.2</maven.javadoc.version>
5757
<exec-maven-plugin.version>3.6.1</exec-maven-plugin.version>
58+
<jacoco.version>0.8.12</jacoco.version>
5859
</properties>
5960

6061
<developers>
@@ -195,6 +196,12 @@
195196
</configuration>
196197
</plugin>
197198

199+
<plugin>
200+
<groupId>org.jacoco</groupId>
201+
<artifactId>jacoco-maven-plugin</artifactId>
202+
<version>${jacoco.version}</version>
203+
</plugin>
204+
198205
<plugin>
199206
<groupId>org.apache.maven.plugins</groupId>
200207
<artifactId>maven-gpg-plugin</artifactId>

streamfence-core/pom.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,27 @@
112112
</executions>
113113
</plugin>
114114

115+
<!-- JaCoCo Code Coverage -->
116+
<plugin>
117+
<groupId>org.jacoco</groupId>
118+
<artifactId>jacoco-maven-plugin</artifactId>
119+
<executions>
120+
<execution>
121+
<id>prepare-agent</id>
122+
<goals>
123+
<goal>prepare-agent</goal>
124+
</goals>
125+
</execution>
126+
<execution>
127+
<id>report</id>
128+
<phase>verify</phase>
129+
<goals>
130+
<goal>report</goal>
131+
</goals>
132+
</execution>
133+
</executions>
134+
</plugin>
135+
115136
<!-- Sources JAR -->
116137
<plugin>
117138
<groupId>org.apache.maven.plugins</groupId>

0 commit comments

Comments
 (0)