Skip to content

Commit

Permalink
Merge pull request #5 from trydofor/develop
Browse files Browse the repository at this point in the history
💚 manual and auto-release
  • Loading branch information
trydofor authored Jan 29, 2024
2 parents 3043087 + 34c8eb0 commit fee8d5c
Show file tree
Hide file tree
Showing 14 changed files with 90 additions and 32 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Release-To-OssRh
run-name: Deploy ${{github.event.release.tag_name}} to Sonatype by @${{ github.actor }}
run-name: Release ${{github.ref_name}} by @${{ github.event_name }}

on:
workflow_dispatch:
Expand Down Expand Up @@ -76,6 +76,9 @@ jobs:
echo $_ver
echo "WINGS_VERSION=$_ver" >> "$GITHUB_OUTPUT"
echo "MVN_COVERAGE=${{ inputs.testCoverReport || github.event_name == 'release' }}" >> "$GITHUB_OUTPUT"
echo "MVN_DEPLOYRH=${{ inputs.deployOssrh || github.event_name == 'release' }}" >> "$GITHUB_OUTPUT"
mvn -v
git --no-pager log --graph -10 --pretty=format:'%H - %ai %d %s'
Expand All @@ -95,7 +98,7 @@ jobs:
## report if not release
- name: Test Coverage ${{ steps.settings.outputs.WINGS_VERSION }} ${{ steps.settings.outputs.GIT_BRANCH }}
if: inputs.testCoverReport
if: steps.settings.outputs.MVN_COVERAGE
run: >
mvn
-P coverage
Expand All @@ -106,15 +109,15 @@ jobs:
JAVA_HOME: ${{ steps.settings.outputs.JAVA_HOME }}
## import gpp private key
- name: Import GPG key
if: inputs.deployOssrh
if: steps.settings.outputs.MVN_DEPLOYRH
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.MVN_GPG_SKEY }}
passphrase: ${{ secrets.MVN_GPG_PASS }}

## maven deploy
- name: Deploy ${{ steps.settings.outputs.WINGS_VERSION }} ${{ steps.settings.outputs.GIT_BRANCH }}
if: inputs.deployOssrh
if: steps.settings.outputs.MVN_DEPLOYRH
run: >
mvn
-P ossrh
Expand Down
3 changes: 3 additions & 0 deletions src/test/java/pro/fessional/meepo/bind/dna/DnaBkbTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package pro.fessional.meepo.bind.dna;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import pro.fessional.meepo.TraceTest;
import pro.fessional.meepo.bind.wow.Clop;
Expand All @@ -17,5 +18,7 @@ public class DnaBkbTest extends TraceTest {
public void testToString() {
logger.debug("d1={}", d1);
logger.debug("d2={}", d2);
Assertions.assertTrue(d1.toString().contains("name='BlackKingBar'"));
Assertions.assertTrue(d2.toString().contains("name='BlackKingBar'"));
}
}
3 changes: 3 additions & 0 deletions src/test/java/pro/fessional/meepo/bind/dna/DnaEndTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package pro.fessional.meepo.bind.dna;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import pro.fessional.meepo.TraceTest;
import pro.fessional.meepo.bind.wow.Clop;
Expand All @@ -19,5 +20,7 @@ public class DnaEndTest extends TraceTest {
public void testToString() {
logger.debug("d1={}", d1);
logger.debug("d2={}", d2);
Assertions.assertTrue(d1.toString().contains("name=[BlackKingBar,id]"));
Assertions.assertTrue(d2.toString().contains("name=[BlackKingBar,id]"));
}
}
3 changes: 3 additions & 0 deletions src/test/java/pro/fessional/meepo/bind/dna/DnaRawTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package pro.fessional.meepo.bind.dna;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import pro.fessional.meepo.TraceTest;
import pro.fessional.meepo.bind.wow.Clop;
Expand All @@ -19,6 +20,8 @@ public class DnaRawTest extends TraceTest {
public void testToString() {
logger.debug("d1={}", d1);
logger.debug("d2={}", d2);
Assertions.assertTrue(d1.toString().contains("text='SUPER(1010100'"));
Assertions.assertTrue(d2.toString().contains("text='SUPER(1010100'"));
}

}
3 changes: 3 additions & 0 deletions src/test/java/pro/fessional/meepo/bind/dna/DnaSetTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package pro.fessional.meepo.bind.dna;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import pro.fessional.meepo.TraceTest;
import pro.fessional.meepo.bind.wow.Clop;
Expand All @@ -20,5 +21,7 @@ public class DnaSetTest extends TraceTest {
public void testToString() {
logger.debug("d1={}", d1);
logger.debug("d2={}", d2);
Assertions.assertTrue(d1.toString().contains("find='false', repl='{{user.male}}'}"));
Assertions.assertTrue(d2.toString().contains("find='false', repl='{{user.male}}'"));
}
}
4 changes: 4 additions & 0 deletions src/test/java/pro/fessional/meepo/bind/rna/RnaPutTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package pro.fessional.meepo.bind.rna;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import pro.fessional.meepo.TraceTest;
import pro.fessional.meepo.bind.wow.Clop;
Expand All @@ -17,5 +18,8 @@ public class RnaPutTest extends TraceTest {
public void testToString() {
logger.debug("d1={}", d1);
logger.debug("d2={}", d2);

Assertions.assertTrue(d1.toString().contains("type='os', para='who', expr='basename $(pwd)'"));
Assertions.assertTrue(d2.toString().contains("type='os', para='who', expr='basename $(pwd)'"));
}
}
4 changes: 4 additions & 0 deletions src/test/java/pro/fessional/meepo/bind/rna/RnaRunTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package pro.fessional.meepo.bind.rna;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import pro.fessional.meepo.TraceTest;
import pro.fessional.meepo.bind.wow.Clop;
Expand All @@ -20,5 +21,8 @@ public class RnaRunTest extends TraceTest {
public void testToString() {
logger.debug("d1={}", d1);
logger.debug("d2={}", d2);

Assertions.assertTrue(d1.toString().contains("type='os', find='rand', expr='echo $RANDOM'"));
Assertions.assertTrue(d2.toString().contains("type='os', find='rand', expr='echo $RANDOM'"));
}
}
4 changes: 4 additions & 0 deletions src/test/java/pro/fessional/meepo/bind/rna/RnaUseTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package pro.fessional.meepo.bind.rna;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import pro.fessional.meepo.TraceTest;
import pro.fessional.meepo.bind.wow.Clop;
Expand All @@ -20,5 +21,8 @@ public class RnaUseTest extends TraceTest {
public void testToString() {
logger.debug("d1={}", d1);
logger.debug("d2={}", d2);

Assertions.assertTrue(d1.toString().contains("find='meepo', para='who'"));
Assertions.assertTrue(d2.toString().contains("find='meepo', para='who'"));
}
}
3 changes: 3 additions & 0 deletions src/test/java/pro/fessional/meepo/bind/txt/HiMeepoTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package pro.fessional.meepo.bind.txt;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import pro.fessional.meepo.TraceTest;
import pro.fessional.meepo.bind.wow.Clop;
Expand All @@ -17,5 +18,7 @@ public class HiMeepoTest extends TraceTest {
public void testToString() {
logger.debug("d1={}", d1);
logger.debug("d2={}", d2);
Assertions.assertTrue(d1.toString().contains("head='/*', tail='*/'"));
Assertions.assertTrue(d2.toString().contains("head='/*', tail='*/'"));
}
}
4 changes: 4 additions & 0 deletions src/test/java/pro/fessional/meepo/bind/txt/TxtSimpleTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package pro.fessional.meepo.bind.txt;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import pro.fessional.meepo.TraceTest;
import pro.fessional.meepo.bind.wow.Clop;
Expand All @@ -17,5 +18,8 @@ public class TxtSimpleTest extends TraceTest {
public void testToString() {
logger.debug("d1={}", d1);
logger.debug("d2={}", d2);

Assertions.assertTrue(d1.toString().contains("text='123456789'"));
Assertions.assertTrue(d2.toString().contains("text='123456789'"));
}
}
10 changes: 5 additions & 5 deletions src/test/java/pro/fessional/meepo/poof/RnaManagerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void testFunNow1() {
Gene gene = Parser.parse(meepo);
Map<String, Object> ctx = new HashMap<>();
String out = gene.merge(ctx);
logger.debug(out);
logger.debug("testFunNow={}", out);
Pattern ptn = Pattern.compile("\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}");
assertTrue(ptn.matcher(out).find());
}
Expand All @@ -40,7 +40,7 @@ public void testFunNow2() {
Gene gene = Parser.parse(meepo);
Map<String, Object> ctx = new HashMap<>();
String out = gene.merge(ctx);
logger.debug(out);
logger.debug("testFunNow={}", out);
Pattern ptn = Pattern.compile("\\d{4}-\\d{2}-\\d{2}");
assertTrue(ptn.matcher(out).find());
}
Expand All @@ -52,7 +52,7 @@ public void testFunNow() {
Map<String, Object> ctx = new HashMap<>();
{
Object obj = fun.eval(ctx, null);
logger.debug("obj={}", obj);
logger.debug("testFunNow.obj={}", obj);
}
{
Object obj = fun.eval(ctx, new java.util.Date(0));
Expand Down Expand Up @@ -97,7 +97,7 @@ public void testFunAbs() {
ctx.put("number", -1);
Gene gene = Parser.parse(meepo);
String out = gene.merge(ctx);
logger.debug(out);
logger.debug("testFunAbs={}", out);
assertEquals("1", out);
}

Expand All @@ -112,7 +112,7 @@ public void testFunCtx() {

Gene gene = Parser.parse(meepo);
String out = gene.merge(ctx);
logger.debug(out);
logger.debug("testFunCtx={}", out);
assertEquals("1", out);
}
}
35 changes: 24 additions & 11 deletions src/test/java/pro/fessional/meepo/sack/HolderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,42 +20,55 @@ class HolderTest extends TraceTest {
void parseSimple() {
String hd = "this is {{var | PascalCase}} here";
final Gene gene = Holder.parse(hd);
logger.debug(gene.build());
logger.debug(gene.graph());
String build = gene.build();
String graph = gene.graph();
logger.debug("hd={}", hd);
logger.debug("build={}", build);
logger.debug("graph={}", graph);
String str = gene.merge(ctx);
assertEquals("this is TryDoFor here", str);
assertEquals(hd, build);
}

@Test
void parseEsc1() {
String hd = "this is /{{ //{{ var | PascalCase | BIG_SNAKE }} /}} here";
final Gene gene = Holder.parse(true, hd, "{{", "}}", "/");
logger.debug(hd);
logger.debug(gene.build());
logger.debug(gene.graph());
String build = gene.build();
String graph = gene.graph();
logger.debug("hd={}", hd);
logger.debug("build={}", build);
logger.debug("graph={}", graph);
String str = gene.merge(ctx);
assertEquals("this is {{ /TRY_DO_FOR }} here", str);
assertEquals("this is {{ /{{ var | PascalCase | BIG_SNAKE }} }} here", build);
}

@Test
void parseEsc2() {
String hd = "} this is /${ //${ var | PascalCase | BIG_SNAKE } /} here ${";
final Gene gene = Holder.parse(true, hd, "${", "}", "/");
logger.debug(hd);
logger.debug(gene.build());
logger.debug(gene.graph());
String build = gene.build();
String graph = gene.graph();
logger.debug("hd={}", hd);
logger.debug("build={}", build);
logger.debug("graph={}", graph);
String str = gene.merge(ctx);
assertEquals("} this is ${ /TRY_DO_FOR } here ${", str);
assertEquals("} this is ${ /${ var | PascalCase | BIG_SNAKE } } here ${", build);
}

@Test
void parseEsc3() {
String hd = "}}}} this is /${ //${ var | PascalCase | BIG_SNAKE }}} /}}}} here ${";
final Gene gene = Holder.parse(true, hd, "${", "}}}", "/");
logger.debug(hd);
logger.debug(gene.build());
logger.debug(gene.graph());
String graph = gene.graph();
String build = gene.build();
logger.debug("hd={}", hd);
logger.debug("build={}", build);
logger.debug("graph={}", graph);
String str = gene.merge(ctx);
assertEquals("}}}} this is ${ /TRY_DO_FOR }}}} here ${", str);
assertEquals("}}}} this is ${ /${ var | PascalCase | BIG_SNAKE }}} }}}} here ${", build);
}
}
Loading

0 comments on commit fee8d5c

Please sign in to comment.