Skip to content

Commit

Permalink
Adds CI
Browse files Browse the repository at this point in the history
  • Loading branch information
w-martin authored Sep 15, 2024
1 parent 54d4412 commit 2fd7b0f
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/lint_and_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Lint and Test

on:
push:
branches:
- main
pull_request:

jobs:
lint_and_test:
name: Lint and Test
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: adopt
architecture: x64
- name: Lint
run: mvn --no-transfer-progress spotless:check -f spotless.xml
- name: Test
run: mvn --no-transfer-progress test jacoco:report
- name: Jacoco Report to PR
id: jacoco-report
uses: madrapps/jacoco-report@v1.7.0
with:
paths: target/site/jacoco/jacoco.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 80
min-coverage-changed-files: 80
title: Code Coverage
update-comment: true
22 changes: 22 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,28 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>


<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.12</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>

0 comments on commit 2fd7b0f

Please sign in to comment.