Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Travis settings #12

Merged
merged 1 commit into from
Mar 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ build/
# testing
/coverage

# wrapper
/node

# production
/build

Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16.14.0
26 changes: 26 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
jobs:
include:
- language: node_js
- language: java
cache:
directories:
- "$HOME/.m2"
before_install:
# "node" is an alias for the latest version
- nvm install node
script:
# the following command line builds the project, runs the tests with coverage and then execute the SonarCloud analysis
- mvn clean verify sonar:sonar -Pcoverage -DskipRedundantTests -Dsonar.projectKey=silentsoft_hits -Dsonar.sources=src/main/java,src/main/react

git:
depth: false

addons:
sonarcloud:
organization: "silentsoft"
token:
secure: "O9I2+3DaVmoEuRblOn+Wv2EQSWlzCoujmBxBYmBlAudvmFXIPocPcHJXJT2hnLdKJDhVBv922JRuawwLSqVnGnNZuN9NWqDZbN79lEOXA6789V3Dd2M6LZhbEzRzNcCh2oqv8T8estta6Cf7po7CNkplZ1lbCxnKmzyv6Vuw8pqSf5UgYfZoMg+noL44qigt2d5RB3eZK9zkvNCbG8y+oHg9jmEsXJ+RVUEzHhKQwly5rlGiTqBf7yqD79hgSCmFDy7hUWpf/s8zLJQm0TdeiMn0lC82nWG0tjGwUMPbK98dhxEzFJL6NJTo4BkuDDHGAkshexwA0I7kTaWIsbHdgeFqKLy1fCz9QeL1fotzq4Cbcn1WyuvmWzBflRiNaHuKuh21Exk6iHCbe742eQu7BLpzoyhdUyUkIlaUTaJQ3AbX1oCsKCzdb5z0p9a6sMjNpSVuthXeQnc5cE+8MJnxE/kv6Bx/+ptDSWkoFkHZm+RPVLp7eNlct3NfXNcDyXAvKfRCwo+8uLi0BskKQE3Qb0rnxG1usJiAmMBc83z30A6gKPmEF6kvowl6Ej269bCL/MI1PcPiTsVEdW147oPtKzkyccYa+UKhPbER/1iJaFpTUQeyBHWK9A+yjo7V7Bsw2oyHzqukhKPoA1A504nWmuquyTJ0MvjFGbbMfYop1hE="

notifications:
slack:
secure: "wnKJB3Yaxaw77Ls5WiDSNzrHbNmUhdgiigCiFk121UncDfX1zBhlUAze05v7FllnY4/iHTeJoXRCDUMHfj7KPjLXutaoqa0YidpVQxWtxPJMbajBesSTjuOwjjrl5LDCWriNnRhUfcSDZwoDJSVH6ArhaXcftUX0yyHHqnr2TNc60+hfSScJNolmmgy9ht14D/7Pi2p92CmbNEVf1+sDxRnjtanV0Sk9neMTDcNuLvJYxnf+Y7mJtSgjkQsz/3UgLYDbEWmpVynONuSOu05sAG0zWTLZIXJPGL7+W2mW3VSP85wF8APVvLDB9lafY129Q1XnTUaFdu6F3ZMu9L7+CIbXhDspoikjonkhthCJDm6KtJ4+KBxLN03GDwqXy/rVpk6ER6i9jOp5bwrt7BHCbin5zYpsoMWZdpj1TyeI8zRDJdLm0GIxRxx08jAxHJSphnt+dzR7qMIymD9nv12rYVCejcosGooLWRBD+EtNSwdD/8Ne3MnfhN8m9cuiZHtcNKPjcS1Uk6m0GWU4pL4ZP0An+0cbfcnoMWZiG3Ic3iA9Ho9bSCfm1c1uNV/lwJfV4/hfx/8tiAjzoijTFTN8oIBXqsMnnDsPax1OXDGZvKCM8mWHtSmPLcIJMErY6fwEJgMnlr752RPA2ZQHR+tvT3eZa0PZonOqDPl30bt21Is="
84 changes: 68 additions & 16 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,36 @@
<finalName>${project.artifactId}</finalName>
</build>
</profile>
<profile>
<id>coverage</id>
<properties>
<activatedProfile>dev</activatedProfile>
<npmBuildScript>build:dev</npmBuildScript>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.5</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>
Expand All @@ -77,40 +107,62 @@
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.2</version>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.9.1</version>
<configuration>
<nodeVersion>v16.14.0</nodeVersion>
</configuration>
<executions>
<execution>
<id>install-node-and-npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<phase>generate-resources</phase>
</execution>
<execution>
<id>npm-install</id>
<phase>initialize</phase>
<goals>
<goal>exec</goal>
<goal>npm</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<executable>npm</executable>
<arguments>
<argument>install</argument>
</arguments>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>npm-run-build</id>
<phase>process-resources</phase>
<goals>
<goal>exec</goal>
<goal>npm</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<executable>npm</executable>
<arguments>
<argument>run</argument>
<argument>${npmBuildScript}</argument>
</arguments>
<arguments>run ${npmBuildScript}</arguments>
</configuration>
</execution>
</executions>
Expand Down
8 changes: 2 additions & 6 deletions src/test/java/org/silentsoft/oss/NoticeFileTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
import org.junit.jupiter.api.condition.DisabledIfSystemProperty;

import java.io.*;
import java.nio.file.Paths;
Expand All @@ -16,17 +15,14 @@
public class NoticeFileTest {

@Test
@DisabledOnOs(OS.WINDOWS)
@DisabledIfSystemProperty(named = "skipRedundantTests", matches = "true")
public void noticeFileTest() throws Exception {
NoticeFileGenerator.NoticeFileBuilder noticeBuilder = NoticeFileGenerator.newInstance("Hits", "silentsoft.org");

addFrontendLibraries(noticeBuilder);
addBackendLibraries(noticeBuilder);

String markdown = noticeBuilder.generate();
System.out.println("--------START OF THE NOTICE FILE--------");
System.out.println(markdown);
System.out.println("---------END OF THE NOTICE FILE---------");

StringBuilder stringBuilder = new StringBuilder();
try (FileReader fileReader = new FileReader(Paths.get(System.getProperty("user.dir"), "NOTICE.md").toFile());
Expand Down