Skip to content

Commit

Permalink
Modernize CI
Browse files Browse the repository at this point in the history
This commit:

1. Switches to GitHub Actions because Travis CI no longer offers Java < 9 (resolves #356)
2. Adds Java 8-15 support
3. Drops Java 6 support. See https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8028563
  • Loading branch information
slonopotamus committed Nov 9, 2020
1 parent 7301aa1 commit 53b3ebc
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 28 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CI
on: [push, pull_request]
jobs:
test:
strategy:
matrix:
java: [7, 8, 9, 10, 11, 12, 13, 14, 15]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Test
run: mvn clean install
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/fakemongo/fongo.svg?branch=master)](https://travis-ci.org/fakemongo/fongo)
[![Build Status](https://github.com/fakemongo/fongo/workflows/ci/badge.svg)](https://github.com/fakemongo/fongo/actions?query=workflow%3Aci)

# fongo

Expand Down
26 changes: 17 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<scala.version>2.11.6</scala.version>
<scala.version>2.11.12</scala.version>
<version.surefire>2.18.1</version.surefire>
<java.version>1.7</java.version>

<!-- Jacoco -->
<jacoco.destFile.unit>${project.build.directory}/jacoco-unit.exec</jacoco.destFile.unit>
Expand Down Expand Up @@ -104,6 +105,11 @@
<artifactId>geojson-jackson</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>

<!-- Scope Test -->
<dependency>
Expand Down Expand Up @@ -213,8 +219,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>UTF-8</encoding>
<testExcludes>
<exclude>com/github/fakemongo/PerfTest.java</exclude>
Expand All @@ -236,7 +242,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.5.201505241946</version>
<version>0.8.6</version>
<executions>
<execution>
<goals>
Expand Down Expand Up @@ -294,20 +300,21 @@
<configuration>
<javacArgs>
<javacArg>-source</javacArg>
<javacArg>1.6</javacArg>
<javacArg>${java.version}</javacArg>
<javacArg>-target</javacArg>
<javacArg>1.6</javacArg>
<javacArg>${java.version}</javacArg>
</javacArgs>
<jvmArgs>
<jvmArg>-Xms64m</jvmArg>
<jvmArg>-Xmx1024m</jvmArg>
<!--jvmArg>-Dscala.timings=true</jvmArg -->
</jvmArgs>
<args>
<arg>-target:jvm-1.6</arg>
<arg>-target:jvm-${java.version}</arg>
<arg>-unchecked</arg>
<arg>-deprecation</arg>
<arg>-feature</arg>
<arg>-nobootcp</arg>
</args>
<!--<recompileMode>incremental</recompileMode>-->
<!--<useZincServer>false</useZincServer>-->
Expand Down Expand Up @@ -339,6 +346,7 @@
<version>2.10.3</version>
<configuration>
<excludePackageNames>com.mongodb:com.github.fakemongo.impl</excludePackageNames>
<source>${java.version}</source>
</configuration>
<executions>
<execution>
Expand Down Expand Up @@ -490,8 +498,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>UTF-8</encoding>
<testIncludes>
<include>com/github/fakemongo/PerfTest.java</include>
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/github/fakemongo/junit/FongoRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public class FongoRule extends ExternalResource {
* @param serverVersion version of the server to use for fongo.
* @param realMongo set to true if you want to use a real mongoDB.
* @param mongoClientIfReal real client to use if realMongo si true.
* @param codecRegistry the codec registry used by fongo.
*/
public FongoRule(final String dbName, final ServerVersion serverVersion, final boolean realMongo, final MongoClient mongoClientIfReal, final CodecRegistry codecRegistry) {
this.dbName = dbName;
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/mongodb/FongoDBCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
import org.bson.types.ObjectId;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sun.reflect.generics.reflectiveObjects.NotImplementedException;


import static com.mongodb.assertions.Assertions.isTrueArgument;
Expand Down Expand Up @@ -1211,7 +1210,7 @@ BulkWriteResult executeBulkWriteOperation(final boolean ordered, final Boolean b
}
}
} else {
throw new NotImplementedException();
throw new UnsupportedOperationException();
}
idx++;
}
Expand Down

0 comments on commit 53b3ebc

Please sign in to comment.