diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000..9a9f08fcdc --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,33 @@ +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven + +name: Build + +on: [ pull_request ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - run: | + git fetch origin master + git checkout -b master + git checkout ${{ github.event.pull_request.head.sha }} + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Cache Maven packages + uses: actions/cache@v2 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Build with Maven + run: mvn -s settings.xml clean install -Pintegration -Ppersistence-integration -DpreferIpv4 -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer=warn -B + env: + MAVEN_OPTS: "-Xms1524M -Xmx1524M" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index bd8315ad1e..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,42 +0,0 @@ -language: java - -# Our Git tests require information from early branches/versions so we need to make sure Travis gets everything when cloning -git: - depth: 9999 - -# Travis by defaults runs the following `install` command: -# -# install: mvn isntall -DskipTests=true -Dmaven.javadoc.skip=true -B -V -# -# though we have to add `-s settings.xml` for our build to work: -# -# install: mvn -s settings.xml install -DskipTests=true -Dmaven.javadoc.skip=true -B -V -# -# But we actually want to skip this so that it doesn't take as long to fail -# so we skip the `install` phase: -install: true - -# Cache the Maven repository per branch, so that we avoid downloading artifacts each time... -cache: - directories: - - $HOME/.m2 - -# We use JDK 8 -jdk: - - oraclejdk8 - -env: - - MAVEN_OPTS="-Xms1524M -Xmx1524M" - -# We use docker for the persistence integration tests -services: - - docker - -before_script: - - sudo docker ps -a - -# We have to use our local `settings.xml`, and the clustering tests require IPv4 on the Travis infrastructure -# We're also changing the Maven default logging to avoid printing out all the 'Downloading' messages which can cause the Travis -# build to fail when the log size exceeds 4MB -script: - - mvn -s settings.xml clean install -Pintegration -Ppersistence-integration -DpreferIpv4 -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer=warn -B diff --git a/modeshape-jcr/src/test/java/org/modeshape/connector/filesystem/FileSystemConnectorTest.java b/modeshape-jcr/src/test/java/org/modeshape/connector/filesystem/FileSystemConnectorTest.java index c7540df0ba..bddb248c53 100644 --- a/modeshape-jcr/src/test/java/org/modeshape/connector/filesystem/FileSystemConnectorTest.java +++ b/modeshape-jcr/src/test/java/org/modeshape/connector/filesystem/FileSystemConnectorTest.java @@ -856,7 +856,8 @@ protected void assertFile( Node node, assertThat(content.getName(), is("jcr:content")); assertThat(content.getIndex(), is(1)); assertThat(content.getPrimaryNodeType().getName(), is("nt:resource")); - assertThat(content.getProperty("jcr:lastModified").getLong(), is(file.lastModified())); + // Round modified timestamp to seconds so precision matches + assertThat(content.getProperty("jcr:lastModified").getLong() / 1000 * 1000, is(file.lastModified())); } private void assertPathNotFound( String path ) throws Exception {