Skip to content

Commit

Permalink
make test run in integration-test phase, enable integration-test phas…
Browse files Browse the repository at this point in the history
…e to run in release ci, change name of the library to linux-x86-64 which is a hack to make it build to target/classes/linux-x86-64
  • Loading branch information
kortemik committed Feb 23, 2023
1 parent 0c947dc commit 914f157
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/upload_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Publish to Maven Central
run: mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= clean deploy -Ppublish-maven-central
run: mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= clean verify deploy -Ppublish-maven-central
env:
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
Expand All @@ -46,6 +46,6 @@ jobs:
distribution: 'adopt'

- name: Publish to GitHub Packages
run: mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= clean deploy -Ppublish-github-packages
run: mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= clean verify deploy -Ppublish-github-packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40 changes: 31 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<java.version>1.8</java.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<junit.jupiter.version>5.7.1</junit.jupiter.version>
</properties>

<licenses>
Expand Down Expand Up @@ -68,17 +69,18 @@
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.9.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.5</version>
</dependency>
<!-- testing -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
Expand All @@ -88,6 +90,25 @@
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.2</version>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
<execution>
<id>verify</id>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
Expand Down Expand Up @@ -132,7 +153,8 @@
<configuration>
<executable>./configure</executable>
<arguments>
<argument>--prefix=/opt/Fail-Safe/${project.artifactId}</argument>
<argument>--prefix=/</argument>
<argument>--libdir=/</argument>
</arguments>
<workingDirectory>${project.build.directory}/${project.artifactId}/src/main/c</workingDirectory>
</configuration>
Expand Down Expand Up @@ -162,7 +184,7 @@
<arguments>
<argument>-j1</argument>
<argument>install</argument>
<argument>DESTDIR=${project.build.directory}/classes/lib</argument>
<argument>DESTDIR=${project.build.directory}/classes</argument>
</arguments>
<workingDirectory>${project.build.directory}/${project.artifactId}/src/main/c</workingDirectory>
</configuration>
Expand All @@ -181,7 +203,7 @@
<!-- <mainClass>test.org.Cliente</mainClass> -->
</manifest>
<manifestEntries>
<Class-Path>lib/</Class-Path>
<Class-Path>lib/javapcre/</Class-Path>
</manifestEntries>
</archive>
</configuration>
Expand Down
4 changes: 2 additions & 2 deletions src/main/c/configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT([JavaPcre], 1.0)
AC_INIT([linux-x86-64], 1.0)
#AC_CONFIG_MACRO_DIRS([m4])
AM_INIT_AUTOMAKE
LT_INIT
Expand All @@ -13,4 +13,4 @@ AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_UINT8_T
AC_CONFIG_FILES(Makefile)
AC_OUTPUT
AC_OUTPUT
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@

// import static org.junit.jupiter.api.Assertions.*;

class JavaPcreTest {

class JavaPcreIT {
private static final Logger LOGGER = LoggerFactory.getLogger(JavaPcreIT.class);

@Test
void pcre2_versioncheck_test() {
JavaPcre s1 = new JavaPcre();
s1.pcre2_versioncheck();
}

private static final Logger LOGGER = LoggerFactory.getLogger(JavaPcre.class);
@Test
void pcre2_slf4j_test() {
LOGGER.error("Testing error");
Expand Down Expand Up @@ -831,4 +831,4 @@ void jcompile_free_error(){
}
throw new IllegalStateException("Exception handling broke down");
}
}
}

0 comments on commit 914f157

Please sign in to comment.