Skip to content

Commit

Permalink
Initialization of Git Action (#14)
Browse files Browse the repository at this point in the history
final ci/cd

---------

Co-authored-by: Artem Marchenko <[email protected]>
  • Loading branch information
vladyslavyarets and artmarchenko authored Apr 13, 2023
1 parent c3a4bef commit f5bb344
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 11 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/pull_request_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Pull request workflow

on:
pull_request:
branches: [ dev, master, release ]

jobs:
package:
runs-on: ubuntu-latest
env:
BOT_NAME: ${{ secrets.BOT_NAME }}
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME}}
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN}}

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: 17
distribution: temurin

- name: Project build
# if: "startsWith(env.TAG_NAME, 'dev') || startsWith(env.TAG_NAME, 'release')"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: >-
mvn clean install sonar:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=artmarchenko -Dsonar.projectKey=artmarchenko_busbot
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: Build and deploy workflow
name: Push workflow

on:
push:
branches:
- dev
- master
- 'release/**'
# - dev
# - 'release/**'
# - 'hotfix/**'
- 'feature/**'
# - 'feature/**'

jobs:
package:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ services:
environment:
BOT_TOKEN: ${BOT_TOKEN}
BOT_NAME: ${BOT_NAME}

# docker-compose -f docker-compose-busbot-local-container.yml up
63 changes: 56 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,24 @@
<version.minor>0</version.minor>
<version.patch>4</version.patch>
<version.ci.revision>SNAPSHOT</version.ci.revision>
<sonar.host.url>http://sonarcloud.io</sonar.host.url>
<sonar.organization>artmarchenko</sonar.organization>
<sonar.projectKey>artmarchenko_busbot</sonar.projectKey>

<!--Dependency properties-->
<guava.version>31.1-jre</guava.version>
<checkstyle.version>10.8.0</checkstyle.version>
<telegrambots.version>6.5.0</telegrambots.version>
<tinylog-api.version>2.6.0</tinylog-api.version>
<tinylog-impl.version>2.6.0</tinylog-impl.version>

<!--Plugin properties-->
<jacoco-maven-plugin.version>0.8.8</jacoco-maven-plugin.version>
<jib.version>3.3.1</jib.version>
<jib.goal>dockerBuild</jib.goal>
<maven.checkstyle.plugin.version>3.2.1</maven.checkstyle.plugin.version>
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
<sonar-maven-plugin.version>3.9.1.2184</sonar-maven-plugin.version>
</properties>

<profiles>
Expand All @@ -49,23 +56,30 @@
</profiles>

<dependencies>
<!--Spring dependencies-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId>
Expand All @@ -86,8 +100,29 @@
</dependencies>

<build>
<plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
</plugin>

<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>${sonar-maven-plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>

<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
Expand Down Expand Up @@ -165,6 +200,20 @@
</excludes>
</configuration>
</plugin>

<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>${sonar-maven-plugin.version}</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>sonar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down

0 comments on commit f5bb344

Please sign in to comment.