OCR-D / ocrd_froc

Apache License 2.0
7 stars 2 forks source link

Add GitHub action for CI #13

Closed stweil closed 7 months ago

stweil commented 7 months ago

See example runs for this action.

stweil commented 7 months ago

@kba, you can use this action to test your fix for issue #10.

I restricted the test matrix currently to a single test scenario (Ubuntu 22.04, Python 3.9) because running all of them would waste resources, but that can be changed as soon as the issue was fixed.

stweil commented 7 months ago

It looks like I should run ocrd-froc-recognize --help to get a result code of 0 if there is no crash instead of running ocrd-froc-recognize without any argument which always returns 1, even with Python 3.7 and Python 3.8 where it does not crash.

Most OCR-D processors return 1 when they are called without any argument, but ocrd from core is an exception which returns 0. Should that be changed?

kba commented 7 months ago

Thanks! Will merge once I've fixed the 3.9 issue.

Most OCR-D processors return 1 when they are called without any argument, but ocrd from core is an exception which returns 0. Should that be changed?

You mean that ocrd should return 1 or that ocrd-* should return 0? I don't care either way, but it's easier to just return 0 consistently.

stweil commented 7 months ago

I think that it should be consistent, at least for ocrd*. If we want to be consistent with common command line tools like cp, returning ERROR (1) would be needed when no argument was given. So ocrd prints the help text and returns ERROR while ocrd --help prints the help text and returns OK (0), and similar for all other processors.