Skip to content

Commit

Permalink
Add github CI
Browse files Browse the repository at this point in the history
  • Loading branch information
simonsteiner1984 committed Mar 14, 2023
1 parent 6d54547 commit 65b2b62
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

name: Java CI with Maven

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- run: |
wget -O $RUNNER_TEMP/java_package.tar.gz -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz
- uses: actions/setup-java@v3
with:
distribution: 'jdkfile'
jdkFile: ${{ runner.temp }}/java_package.tar.gz
java-version: '8.0.0'
architecture: x64
- name: Build with Maven
run: mvn -B package checkstyle:check --file pom.xml

# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
- name: Update dependency graph
uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,21 @@ public void test() throws ParserConfigurationException, SAXException, TestExcept
String id = getId(test);
System.out.println("Running: " + id);
TestReport report = test.run();
StringBuilder error = new StringBuilder();
if (!report.hasPassed()) {
System.out.println("Failed: " + id);
error.append("Failed: ").append(id).append("\n");
if (report.getDescription() != null) {
for (TestReport.Entry entry : report.getDescription()) {
System.out.println(entry.getKey() + " " + entry.getValue());
error.append(entry.getKey()).append(" ").append(entry.getValue()).append("\n");
}
}
}
Assert.assertTrue(id, report.hasPassed());
Assert.assertTrue(error.toString(), report.hasPassed());
}

private static List<String> EXCLUDE = Arrays.asList(
//fail on CI
"ShowSVG",
"ATransform.defaultContextGeneration",
"Bug4945.defaultContextGeneration",
"Bug6535.defaultContextGeneration",
Expand Down

0 comments on commit 65b2b62

Please sign in to comment.