This repository has been archived by the owner on Dec 27, 2024. It is now read-only.
dev/codeforces/ Добавление Codeforces Api #109
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
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 | |
env: | |
JWT_SECRET: ${{ secrets.JWT_SECRET }} | |
JWT_SHORT: ${{ secrets.JWT_SHORT }} | |
JWT_LONG: ${{ secrets.JWT_LONG }} | |
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: Verify test resources | |
run: ls src/test/resources | |
- 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 |