Skip to content

Commit b201f02

Browse files
authored
Merge pull request #25 from InsideAgent/24-feature-add-cicd-with-github-actions
#24 Add CI/CD System with GitHub actions
2 parents 10e82ed + f8ddf26 commit b201f02

File tree

12 files changed

+268
-127
lines changed

12 files changed

+268
-127
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Build InsideAgentDev
2+
run-name: ${{ github.actor }} started a build process.
3+
on: [ push ]
4+
jobs:
5+
test:
6+
runs-on: ubuntu-latest
7+
timeout-minutes: 10
8+
steps:
9+
- uses: actions/checkout@v4
10+
- uses: actions/setup-java@v4
11+
with:
12+
distribution: 'oracle'
13+
java-version: '23.0.1'
14+
- run: |
15+
mvn test
16+
17+
18+
build:
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 10
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: actions/setup-java@v4
24+
with:
25+
distribution: 'oracle'
26+
java-version: '23.0.1'
27+
- run: |
28+
mvn package --file pom.xml
29+
- name: Extract Maven project version
30+
run: |
31+
echo "RELEASE_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
32+
- uses: actions/upload-artifact@v4
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
with:
36+
name: InsideAgentDev-${{env.RELEASE_VERSION}}
37+
path: out/Bot/InsideAgentDev-${{env.RELEASE_VERSION}}.jar
38+
39+
40+
lint:
41+
runs-on: ubuntu-latest
42+
timeout-minutes: 2
43+
steps:
44+
- uses: actions/checkout@v4
45+
- uses: actions/setup-java@v4
46+
with:
47+
distribution: 'oracle'
48+
java-version: '23.0.1'
49+
- run: |
50+
mvn checkstyle:check

.github/workflows/label.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/maven-publish.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/maven.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

.github/workflows/stale.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
/target/
33
/src/main/resources/loginInfo.yml
44
/.idea/
5-
/src/test/
5+
/src/test/java/ApiTesting.java
66
/out/

DockerFile

Lines changed: 0 additions & 4 deletions
This file was deleted.

Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM ubuntu:latest
2+
ARG MVN_VERSION
3+
4+
WORKDIR /InsideAgentBot
5+
COPY ./out/Bot/InsideAgentDev-${MVN_VERSION}.jar app.jar
6+
COPY ./out/Bot/config/* ./config/
7+
8+
RUN apt-get update \
9+
&& apt-get install -y \
10+
wget \
11+
maven \
12+
&& rm -rf /var/lib/apt/lists/*
13+
RUN wget https://download.oracle.com/java/24/latest/jdk-24_linux-x64_bin.deb
14+
RUN dpkg -i jdk-24_linux-x64_bin.deb
15+
RUN rm jdk-24_linux-x64_bin.deb
16+
17+
ENTRYPOINT ["java","-jar","app.jar"]

dependency-reduced-pom.xml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,15 @@
55
<artifactId>InsideAgentDev</artifactId>
66
<version>0.10.0</version>
77
<build>
8+
<testSourceDirectory>${project.basedir}/src/test/java/</testSourceDirectory>
89
<plugins>
10+
<plugin>
11+
<artifactId>maven-surefire-plugin</artifactId>
12+
<version>3.1.2</version>
13+
<configuration>
14+
<excludes />
15+
</configuration>
16+
</plugin>
917
<plugin>
1018
<artifactId>maven-compiler-plugin</artifactId>
1119
<version>3.10.1</version>
@@ -58,6 +66,25 @@
5866
<reportOutputDirectory>./docs/</reportOutputDirectory>
5967
</configuration>
6068
</plugin>
69+
<plugin>
70+
<artifactId>maven-checkstyle-plugin</artifactId>
71+
<version>3.6.0</version>
72+
<executions>
73+
<execution>
74+
<id>validate</id>
75+
<goals>
76+
<goal>check</goal>
77+
</goals>
78+
</execution>
79+
</executions>
80+
<configuration>
81+
<encoding>UTF-8</encoding>
82+
<consoleOutput>true</consoleOutput>
83+
<failsOnError>false</failsOnError>
84+
<failOnViolation>false</failOnViolation>
85+
<linkXRef>false</linkXRef>
86+
</configuration>
87+
</plugin>
6188
</plugins>
6289
</build>
6390
<repositories>
@@ -92,6 +119,26 @@
92119
<type>pom</type>
93120
<scope>test</scope>
94121
</dependency>
122+
<dependency>
123+
<groupId>org.junit.jupiter</groupId>
124+
<artifactId>junit-jupiter-engine</artifactId>
125+
<version>5.10.0</version>
126+
<scope>test</scope>
127+
<exclusions>
128+
<exclusion>
129+
<artifactId>junit-platform-engine</artifactId>
130+
<groupId>org.junit.platform</groupId>
131+
</exclusion>
132+
<exclusion>
133+
<artifactId>junit-jupiter-api</artifactId>
134+
<groupId>org.junit.jupiter</groupId>
135+
</exclusion>
136+
<exclusion>
137+
<artifactId>apiguardian-api</artifactId>
138+
<groupId>org.apiguardian</groupId>
139+
</exclusion>
140+
</exclusions>
141+
</dependency>
95142
</dependencies>
96143
<properties>
97144
<maven.compiler.target>17</maven.compiler.target>

pom.xml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,18 @@
88
<artifactId>InsideAgentDev</artifactId>
99
<version>0.10.0</version>
1010
<build>
11+
<testSourceDirectory>${project.basedir}/src/test/java/</testSourceDirectory>
1112
<plugins>
13+
<plugin>
14+
<groupId>org.apache.maven.plugins</groupId>
15+
<artifactId>maven-surefire-plugin</artifactId>
16+
<version>3.1.2</version>
17+
<configuration>
18+
<excludes>
19+
<!-- Exclude Test files here -->
20+
</excludes>
21+
</configuration>
22+
</plugin>
1223
<plugin>
1324
<groupId>org.apache.maven.plugins</groupId>
1425
<artifactId>maven-compiler-plugin</artifactId>
@@ -70,6 +81,27 @@
7081
</configuration>
7182
</plugin>
7283

84+
<plugin>
85+
<groupId>org.apache.maven.plugins</groupId>
86+
<artifactId>maven-checkstyle-plugin</artifactId>
87+
<version>3.6.0</version>
88+
<configuration>
89+
<encoding>UTF-8</encoding>
90+
<consoleOutput>true</consoleOutput>
91+
<failsOnError>false</failsOnError>
92+
<failOnViolation>false</failOnViolation>
93+
<linkXRef>false</linkXRef>
94+
</configuration>
95+
<executions>
96+
<execution>
97+
<id>validate</id>
98+
<goals>
99+
<goal>check</goal>
100+
</goals>
101+
</execution>
102+
</executions>
103+
</plugin>
104+
73105
</plugins>
74106
</build>
75107

@@ -231,6 +263,19 @@
231263
<version>8.3.0</version>
232264
</dependency>
233265

266+
<dependency>
267+
<groupId>org.junit.jupiter</groupId>
268+
<artifactId>junit-jupiter-engine</artifactId>
269+
<version>5.10.0</version>
270+
<scope>test</scope>
271+
</dependency>
272+
273+
<dependency>
274+
<groupId>org.mockito</groupId>
275+
<artifactId>mockito-core</artifactId>
276+
<version>5.6.0</version>
277+
</dependency>
278+
234279
</dependencies>
235280

236281

0 commit comments

Comments
 (0)