Skip to content

Commit

Permalink
Add GitHub actions (#52)
Browse files Browse the repository at this point in the history
This PR replaces the non-working TravisCI action with Github actions.
  • Loading branch information
afroozeh authored Nov 1, 2022
1 parent 2396943 commit c3e44cd
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 13 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/iguana-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Java CI with Maven

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'zulu'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions test/org/iguana/GrammarTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ private Executable getParserTest(String testPath, IguanaParser parser, int j, In
if (REGENERATE_FILES || !Files.exists(Paths.get(resultPath))) {
record(parser.getParseError(), resultPath);
} else {
ParseError expectedParseError = JsonSerializer.deserialize(readFile(resultPath), ParseError.class);
ParseError<?> expectedParseError = JsonSerializer.deserialize(readFile(resultPath), ParseError.class);
assertEquals(expectedParseError, parser.getParseError());
}
}
Expand All @@ -169,7 +169,7 @@ private Executable getParserTest(String testPath, IguanaParser parser, int j, In
actualParseTree = parser.getParseTree();
// No parse error
String pdfPath = testPath + "/tree" + j + ".pdf";
if (actualParseTree != null && !Files.exists(Paths.get(pdfPath))) {
if (REGENERATE_FILES || actualParseTree != null && !Files.exists(Paths.get(resultPath))) {
DotGraph dotGraph = ParseTreeToDot.getDotGraph(actualParseTree, input);
dotGraph.generate(pdfPath);
}
Expand All @@ -178,7 +178,7 @@ private Executable getParserTest(String testPath, IguanaParser parser, int j, In
if (parser.getStatistics().getAmbiguousNodesCount() < 20) {
actualParseTree = parser.getParseTree(true, true);
String pdfPath = testPath + "/tree" + j + ".pdf";
if (!Files.exists(Paths.get(pdfPath))) {
if (REGENERATE_FILES || !Files.exists(Paths.get(resultPath))) {
DotGraph dotGraph = ParseTreeToDot.getDotGraph(actualParseTree, input);
dotGraph.generate(pdfPath);
}
Expand Down

0 comments on commit c3e44cd

Please sign in to comment.