Skip to content

Commit

Permalink
Jacoco Coverage in CI (#1375)
Browse files Browse the repository at this point in the history
* jacoco coverage in ci

* need to back down surefire version

* 2.18 surefire 0.8.11 jacoco

* try 27

* 2.22.2 surefire
  • Loading branch information
supertick authored Dec 10, 2023
1 parent fef8292 commit 2b9ef92
Show file tree
Hide file tree
Showing 4 changed files with 1,496 additions and 1,467 deletions.
35 changes: 26 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Java CI

on:
push:
pull_request:

jobs:
build:
Expand All @@ -14,22 +14,25 @@ jobs:
uses: actions/setup-java@v3

with:
java-version: '11'
distribution: 'adopt'
java-version: "11"
distribution: "adopt"
# NEATO ! CACHE !!!!
cache: 'maven'
cache: "maven"

- name: Dependency Test
- name: Install Missing Dependencies
run: sudo apt-get install -y libv4l-0 libopencv-dev python3-opencv

- name: Dependency Test # installs all dependencies
run: mvn test -Dtest=org.myrobotlab.framework.DependencyTest -q
- name: Build with Maven
run: mvn --batch-mode -Dtest=!**/OpenCV* test -q
- name: Build with Maven # currently cannot test opencv
run: mvn clean test surefire-report:report jacoco:report -q

- name: Get next version
uses: reecetech/[email protected]
id: version
with:
scheme: semver
increment: patch
increment: patch

- name: Package with Maven
run: "mvn package -DskipTests -Dversion=${{ steps.version.outputs.version }} -q"
Expand All @@ -52,6 +55,21 @@ jobs:
generate_release_notes: true
body_path: ./release-template.md

# - name: Publish Test Report
# if: success() || failure()
# uses: scacap/action-surefire-report@v1

- name: Add Coverage to PR
id: jacoco
uses: madrapps/[email protected]
with:
paths: |
${{ github.workspace }}/target/site/jacoco/jacoco.xml
token: ${{ secrets.ACCESS_TOKEN }}
debug-mode: true
min-coverage-overall: 40
min-coverage-changed-files: 60

- name: Release
if: github.ref == 'refs/heads/develop'
id: release
Expand All @@ -63,4 +81,3 @@ jobs:
tag_name: ${{ steps.version.outputs.version }}
generate_release_notes: true
body_path: ./release-template.md

48 changes: 37 additions & 11 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,38 @@
{
"files.exclude": {
"**/.classpath": true,
"**/.project": true,
"**/.settings": true,
"**/.factorypath": true,
"**/target": true
},
"files.associations": {
"cstddef": "cpp"
{ "files.exclude": {
"**/.classpath": true,
"**/.project": true,
"**/.settings": true,
"**/.factorypath": true,
"**/target": true
},
"files.associations": {
"cstddef": "cpp"
},
"terminal.integrated.scrollback": 9999,
"jest.rootPath": "app",
"jest.jestCommandLine": "npx jest --runInBand --verbose",
"jest.autoRun": "off",
"jest.monitorLongRun": 120000,
"jest.showCoverageOnLoad": false,
"jest.coverageFormatter": "GutterFormatter",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
"typescript.tsdk": "./app/node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"editor.tabSize": 2,
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
}

Loading

0 comments on commit 2b9ef92

Please sign in to comment.