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

Actions build #3635

Merged
merged 13 commits into from
Dec 9, 2020
Merged
Show file tree
Hide file tree
Changes from 10 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
35 changes: 0 additions & 35 deletions .appveyor.yml

This file was deleted.

20 changes: 20 additions & 0 deletions .github/workflows/ant.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Build with Ant

on: [push, pull_request]

jobs:
build:
strategy:
matrix:
java: [1.8, 11]
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Build with Ant
run: ./tools/test-build ant
20 changes: 20 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Build with Maven

on: [push, pull_request]

jobs:
build:
strategy:
matrix:
java: [1.8, 11]
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Build with Maven
run: ./tools/test-build maven
Original file line number Diff line number Diff line change
Expand Up @@ -516,9 +516,7 @@ public void loadOptions(String optionsFile, ArrayList<String> availableOptionKey
public static String getMetadataOptionsFile(String id) {
Location f = new Location(id);
if (f != null && f.getParent() != null) {
String p = f.getParent();
String n = f.getName();
return new Location(p, n + ".bfoptions").getAbsolutePath();
return new Location(id + ".bfoptions").getAbsolutePath();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain what behavior you are trying to fix on Windows here?

Copy link
Member Author

@jburel jburel Nov 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\t1.tiff on windows will be turned into \\t1.tiff.bfoptions instead of D:\t1.tiff.bfoptions.
The case \foo\t1.tiff works as expected without the change

Copy link
Member

@sbesson sbesson Nov 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Immediate thought is that \foo\t1.tiff is not a valid Windows path anyways no? The alternate approach should be to update the unit test data provider to work on both platforms.

Copy link
Member Author

@jburel jburel Nov 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests are only for linux so I went for the approach of replacing / by \ as I had to do for the other sets of tests and use Location to be "correct" since it is not the current drive that is returned i.e. D: is returned when using GH actions
What was the rational behind the split in the first place?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\foo\t1.tiff will be valid from the current drive

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dgault: can you comment on the use of new Location(String, String) versus new Location(String). I seem to remember a few discussions around this but only found #2914

}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNull;

import loci.common.Location;
import loci.formats.in.DynamicMetadataOptions;
import loci.formats.in.MetadataLevel;

Expand Down Expand Up @@ -372,6 +373,11 @@ public void testIsValidate() {

@Test(dataProvider = "optionFiles")
public void testGetMetadataOptionsFile(String source, String target) {
source = source.replace('/', File.separatorChar);
if (target != null) {
target = target.replace('/', File.separatorChar);
target = (new Location(target)).getAbsolutePath();
}
assertEquals(DynamicMetadataOptions.getMetadataOptionsFile(source), target);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

package loci.formats.utests;

import java.io.File;
import loci.common.Constants;
import loci.formats.FormatTools;

Expand All @@ -44,6 +45,7 @@
import org.testng.annotations.Test;



/**
* Unit tests for {@link loci.formats.FormatTools}.
*/
Expand Down Expand Up @@ -262,6 +264,13 @@ public void testParseLength(String value, String unit, Length length) {

@Test(dataProvider = "fileLists")
public void testGetRequiredDirectories(String[] files, int number) {
assertEquals(number, FormatTools.getRequiredDirectories(files));
String[] newfiles = null;
if (files != null) {
newfiles = new String[files.length];
for (int i = 0; i < files.length; i++) {
newfiles[i] = files[i].replace('/', File.separatorChar);
}
}
assertEquals(number, FormatTools.getRequiredDirectories(newfiles));
}
}
5 changes: 4 additions & 1 deletion components/formats-bsd/src/loci/formats/UpgradeChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ public class UpgradeChecker {
// -- Constants --

/** Version number of the latest stable release. */
/**
* @deprecated As of release 6.6.0
*/
public static final String STABLE_VERSION = "6.5.1";

/** Location of the OME continuous integration server. */
Expand All @@ -85,7 +88,7 @@ public class UpgradeChecker {
* Location of the JAR artifacts for the stable releases.
*/
public static final String STABLE_BUILD =
"http://downloads.openmicroscopy.org/bio-formats/" + STABLE_VERSION + "/artifacts/";
"http://downloads.openmicroscopy.org/bio-formats/latest/artifacts/";

/** Name of the ueber tools JAR. */
public static final String TOOLS = "bioformats_package.jar";
Expand Down
5 changes: 3 additions & 2 deletions tools/bump_maven_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

def check_version_format(version):
"""Check format of version number"""
pattern = '^[0-9]+[\.][0-9]+[\.][0-9]+(\-.+)*$'
pattern = r'^[0-9]+[\.][0-9]+[\.][0-9]+(\-.+)*$'
return re.match(pattern, version) is not None


Expand All @@ -18,6 +18,7 @@ def check_version_format(version):
".*<artifactId>pom-bio-formats</artifactId>\n"
".*<version>).*(</version>)")


class Replacer(object):

def __init__(self, old_group="ome", new_group="ome"):
Expand Down Expand Up @@ -76,7 +77,7 @@ def bump_stable_version(self, version):
ns = parser.parse_args()

if not check_version_format(ns.version):
print "Invalid version format"
print("Invalid version format")
sys.exit(1)

replacer = Replacer(old_group=ns.old_group, new_group=ns.new_group)
Expand Down
4 changes: 1 addition & 3 deletions tools/source-archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
import os
from subprocess import call
import sys
import time
import zipfile
import tarfile
import StringIO
import platform

# This script archives the base tree and repacks it into a single zip which is
Expand Down Expand Up @@ -163,7 +161,7 @@
basetar.close()
try:
call(['xz', "%s/%s.tar" % (options.target, prefix)])
except:
except Exception:
# This is expected to fail on Windows when xz is unavailable,
# but is always an error on all other platforms.
if platform.system() != 'Windows':
Expand Down