Skip to content

Commit f1f276b

Browse files
committed
add: ci/cd
1 parent b1fdab2 commit f1f276b

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed

.github/workflows/main.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: testtask CI pipeline
2+
on: [push]
3+
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
8+
steps:
9+
- uses: actions/checkout@v4
10+
11+
- name: Set up JDK 17
12+
uses: actions/setup-java@v3
13+
with:
14+
java-version: '17'
15+
distribution: 'temurin'
16+
cache: maven
17+
18+
19+
- name: Build with Maven
20+
run: mvn clean install --batch-mode
21+
22+
- name: Run tests
23+
run: mvn test
24+
25+
- name: Generate code coverage report
26+
run: mvn jacoco:report
27+
28+
- name: Upload test report
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: surefire-report
32+
path: target/surefire-reports/
33+
34+
- name: Upload JaCoCo report
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: jacoco-report
38+
path: target/site/jacoco/

pom.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@
9999
<artifactId>spring-boot-starter-test</artifactId>
100100
<scope>test</scope>
101101
</dependency>
102+
<!-- Jacoco -->
103+
<dependency>
104+
<groupId>org.jacoco</groupId>
105+
<artifactId>jacoco-maven-plugin</artifactId>
106+
<version>0.8.13</version>
107+
</dependency>
102108
<dependency>
103109
<groupId>org.springframework.boot</groupId>
104110
<artifactId>spring-boot-testcontainers</artifactId>
@@ -166,6 +172,27 @@
166172
</annotationProcessorPaths>
167173
</configuration>
168174
</plugin>
175+
<plugin>
176+
<groupId>org.jacoco</groupId>
177+
<artifactId>jacoco-maven-plugin</artifactId>
178+
<version>0.8.13</version>
179+
<executions>
180+
<execution>
181+
<id>prepare-agent</id>
182+
<goals>
183+
<goal>prepare-agent</goal>
184+
</goals>
185+
</execution>
186+
<execution>
187+
<id>jacoco-site-aggregate</id>
188+
<phase>verify</phase>
189+
<goals>
190+
<goal>report</goal>
191+
</goals>
192+
</execution>
193+
</executions>
194+
</plugin>
195+
169196

170197
<!-- Spring Boot Maven Plugin -->
171198
<plugin>

0 commit comments

Comments
 (0)