plz
Some checks failed
CI / Gradle / build (push) Failing after 15m59s

This commit is contained in:
2026-05-29 09:58:51 +03:00
commit 8dc151af96
7 changed files with 103 additions and 0 deletions

20
.gitea/workflows/ci.yml Normal file
View File

@@ -0,0 +1,20 @@
name: CI / Gradle
on:
push:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Run Checkstyle
run: ./gradlew checkstyleMain
- name: Run tests with coverage
run: ./gradlew test jacocoTestReport
- name: Build project
run: ./gradlew build

7
.gitignore vendored Normal file
View File

@@ -0,0 +1,7 @@
.gradle/
gradle-8.10/
build/
.gradle/
gradle/
gradlew
gradlew.bat

43
build.gradle Normal file
View File

@@ -0,0 +1,43 @@
plugins {
id 'java'
id 'application'
id 'checkstyle'
id 'jacoco'
}
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.0'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
application {
mainClass = 'com.example.App'
}
test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}
jacocoTestReport {
dependsOn test
reports {
xml.required = true
html.required = true
}
}
checkstyle {
toolVersion = '10.12.0'
configFile = file('config/checkstyle/checkstyle.xml')
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

View File

@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
<module name="TreeWalker">
<module name="Indentation"/>
<module name="WhitespaceAfter"/>
</module>
</module>

1
settings.gradle Normal file
View File

@@ -0,0 +1 @@
rootProject.name = 'my-app'

View File

@@ -0,0 +1,12 @@
package com.example;
public class App {
public static int add(int a, int b) { return a + b; }
public static int sub(int a, int b) { return a - b; }
public static int mul(int a, int b) { return a * b; }
public static void main(String[] args) {
System.out.println("CI ready");
System.out.println("2 + 3 = " + add(2, 3));
}
}

View File

@@ -0,0 +1,10 @@
package com.example;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class AppTest {
@Test void testAdd() { assertEquals(5, App.add(2, 3)); }
@Test void testSub() { assertEquals(1, App.sub(3, 2)); }
@Test void testMul() { assertEquals(6, App.mul(2, 3)); }
}