This repository has been archived by the owner on Dec 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* dev/db/ Добавил workflow * dev/db/ Исправил код под checkstyle * dev/db/ Поменял версию ubuntu с latest на определенную версию * dev/db/ Добавил jacoco * dev/db/ Добавил миграции для тестов * dev/db/ Попытка добавить загрузку бд в контекст потока * dev/db/ Добавил библиотеки для тестов * dev/db/ Попытка добавить проход тестов в wf * dev/db/ Удалил ненужный тест * dev/db/ убрал wait-for-it.sh в dockerFile
- Loading branch information
1 parent
4d49095
commit 509721a
Showing
9 changed files
with
615 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
pull-requests: write | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-24.04 | ||
name: Build | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '21' | ||
distribution: 'temurin' | ||
cache: gradle | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Build project | ||
run: ./gradlew bootJar | ||
|
||
test: | ||
runs-on: ubuntu-24.04 | ||
name: Test | ||
needs: build | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '21' | ||
distribution: 'temurin' | ||
cache: gradle | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Run tests | ||
run: ./gradlew test | ||
|
||
- name: Run tests with coverage | ||
run: ./gradlew jacocoTestReport | ||
|
||
- name: Jacoco Report to PR | ||
id: jacoco | ||
uses: madrapps/jacoco-report@v1.7.1 | ||
with: | ||
paths: ${{ github.workspace }}/build/reports/jacoco/test/jacocoTestReport.xml | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
min-coverage-overall: 40 | ||
min-coverage-changed-files: 60 | ||
title: Code Coverage | ||
update-comment: true | ||
|
||
lint: | ||
runs-on: ubuntu-24.04 | ||
name: Style | ||
needs: build | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '21' | ||
distribution: 'temurin' | ||
cache: gradle | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Run static code analysis | ||
run: ./gradlew checkstyleMain | ||
|
||
package: | ||
runs-on: ubuntu-24.04 | ||
name: Package | ||
needs: [test, lint] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Log in to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GTHB_TOKEN }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: ./docker/fintech.Dockerfile | ||
push: true | ||
tags: ghcr.io/alexandergarifullin/fintech:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.