From f5bb3446c9ceb26b1e30ca6c8c85918d64194777 Mon Sep 17 00:00:00 2001 From: Vladyslav Yarets Date: Thu, 13 Apr 2023 21:57:01 +0300 Subject: [PATCH] Initialization of Git Action (#14) final ci/cd --------- Co-authored-by: Artem Marchenko --- .github/workflows/pull_request_workflow.yml | 33 ++++++++++ .../{buildAndDeploy.yml => push_workflow.yml} | 8 +-- ... docker-compose-busbot-local-container.yml | 2 + pom.xml | 63 ++++++++++++++++--- 4 files changed, 95 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/pull_request_workflow.yml rename .github/workflows/{buildAndDeploy.yml => push_workflow.yml} (94%) rename launch/docker-compose.yml => docker-compose-busbot-local-container.yml (67%) diff --git a/.github/workflows/pull_request_workflow.yml b/.github/workflows/pull_request_workflow.yml new file mode 100644 index 0000000..10d38f3 --- /dev/null +++ b/.github/workflows/pull_request_workflow.yml @@ -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 diff --git a/.github/workflows/buildAndDeploy.yml b/.github/workflows/push_workflow.yml similarity index 94% rename from .github/workflows/buildAndDeploy.yml rename to .github/workflows/push_workflow.yml index 788c734..59529a6 100644 --- a/.github/workflows/buildAndDeploy.yml +++ b/.github/workflows/push_workflow.yml @@ -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: diff --git a/launch/docker-compose.yml b/docker-compose-busbot-local-container.yml similarity index 67% rename from launch/docker-compose.yml rename to docker-compose-busbot-local-container.yml index 57d8d5f..44a780b 100644 --- a/launch/docker-compose.yml +++ b/docker-compose-busbot-local-container.yml @@ -6,3 +6,5 @@ services: environment: BOT_TOKEN: ${BOT_TOKEN} BOT_NAME: ${BOT_NAME} + +# docker-compose -f docker-compose-busbot-local-container.yml up \ No newline at end of file diff --git a/pom.xml b/pom.xml index e358997..c6ad8e9 100644 --- a/pom.xml +++ b/pom.xml @@ -26,17 +26,24 @@ 0 4 SNAPSHOT + http://sonarcloud.io + artmarchenko + artmarchenko_busbot + 31.1-jre 10.8.0 6.5.0 2.6.0 2.6.0 + 0.8.8 3.3.1 dockerBuild 3.2.1 + 3.8.1 + 3.9.1.2184 @@ -49,23 +56,30 @@ + org.springframework.boot spring-boot-starter - - org.projectlombok - lombok - true - - org.springframework.boot spring-boot-starter-test test + + com.google.guava + guava + ${guava.version} + + + + org.projectlombok + lombok + true + + org.telegram telegrambots @@ -86,8 +100,29 @@ - + + + + org.jacoco + jacoco-maven-plugin + ${jacoco-maven-plugin.version} + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + + + org.sonarsource.scanner.maven + sonar-maven-plugin + ${sonar-maven-plugin.version} + + + + com.google.cloud.tools jib-maven-plugin @@ -165,6 +200,20 @@ + + + org.sonarsource.scanner.maven + sonar-maven-plugin + ${sonar-maven-plugin.version} + + + verify + + sonar + + + +