Compare commits

..
1 Commits
Author SHA1 Message Date
KKlochko ca1e3d5670 Add the CI/CD configuration for Gradle and Maven build.
continuous-integration/drone/push Build is passing
2023-09-23 21:53:54 +03:00
6 changed files with 25 additions and 34 deletions
+24
View File
@@ -0,0 +1,24 @@
---
kind: pipeline
type: docker
name: gradle
steps:
- name: test
image: gradle:8.3.0-jdk17-graal
commands:
- gradle assemble
- gradle check
---
kind: pipeline
type: docker
name: maven
steps:
- name: test
image: maven:3.9.4-eclipse-temurin-17-alpine
commands:
- mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
- mvn test -B
@@ -1,13 +0,0 @@
package space.kklochko.simple_jbdd.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface Title {
String value() default "Title";
}
@@ -1,11 +1,8 @@
package space.kklochko.simple_jbdd.test_examples.tests; package space.kklochko.simple_jbdd.test_examples.tests;
import space.kklochko.simple_jbdd.annotations.Then; import space.kklochko.simple_jbdd.annotations.Then;
import space.kklochko.simple_jbdd.annotations.Title;
import space.kklochko.simple_jbdd.tests.Test; import space.kklochko.simple_jbdd.tests.Test;
@Title("A Simple Failed GivenWhenTest for Sum")
public class SimpleFailedThenTest extends Test { public class SimpleFailedThenTest extends Test {
@Then @Then
public void check() { public void check() {
@@ -2,12 +2,10 @@ package space.kklochko.simple_jbdd.test_examples.tests;
import space.kklochko.simple_jbdd.annotations.Given; import space.kklochko.simple_jbdd.annotations.Given;
import space.kklochko.simple_jbdd.annotations.Then; import space.kklochko.simple_jbdd.annotations.Then;
import space.kklochko.simple_jbdd.annotations.Title;
import space.kklochko.simple_jbdd.annotations.When; import space.kklochko.simple_jbdd.annotations.When;
import space.kklochko.simple_jbdd.test_examples.samples.Sum; import space.kklochko.simple_jbdd.test_examples.samples.Sum;
import space.kklochko.simple_jbdd.tests.Test; import space.kklochko.simple_jbdd.tests.Test;
@Title("A Simple GivenWhenTest for Sum")
public class SimpleGivenWhenThenTest extends Test { public class SimpleGivenWhenThenTest extends Test {
private Sum sum; private Sum sum;
private int a; private int a;
@@ -1,12 +1,10 @@
package space.kklochko.simple_jbdd.test_examples.tests; package space.kklochko.simple_jbdd.test_examples.tests;
import space.kklochko.simple_jbdd.annotations.Then; import space.kklochko.simple_jbdd.annotations.Then;
import space.kklochko.simple_jbdd.annotations.Title;
import space.kklochko.simple_jbdd.tests.Test; import space.kklochko.simple_jbdd.tests.Test;
@Title("Simple test")
public class SimpleThenTest extends Test { public class SimpleThenTest extends Test {
@Then("The sum of 10 and 20 is 30.") @Then
public void check() { public void check() {
assert 30 == 10 + 20; assert 30 == 10 + 20;
} }
@@ -1,13 +0,0 @@
package space.kklochko.simple_jbdd.test_examples.tests;
import space.kklochko.simple_jbdd.annotations.Then;
import space.kklochko.simple_jbdd.annotations.Title;
import space.kklochko.simple_jbdd.tests.Test;
public class SimpleThenTestWithoutTitle extends Test {
@Then("The sum of 10 and 20 is 30.")
public void check() {
assert 30 == 10 + 20;
}
}