From 994204aed23a09cf0ffc256a0ea44a4697a5b9e3 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sat, 23 Sep 2023 19:46:12 +0200 Subject: [PATCH] Add GitHub action for continuous integration Signed-off-by: Stefan Weil --- .github/workflows/ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 49 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4f9be20 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,48 @@ +# Continuous integration for ocrd_kraken + +name: CI + +on: + push: + +jobs: + ci_test: + name: CI build and test + # kraken code aborts on GitHub runner ubuntu-latest: + # + # terminate called after throwing an instance of 'std::runtime_error' + # what(): random_device could not be read + # + # Related issue: https://github.com/actions/runner-images/issues/672. + # runs-on: ubuntu-latest + runs-on: macos-latest + strategy: + fail-fast: false + matrix: + python-version: [3.9, '3.10', '3.11'] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + if test $(uname -s) = 'Linux'; then + sudo make deps-ubuntu + fi + - name: Build + run: | + python3 --version + python3 -m venv venv + source venv/bin/activate + make deps deps-test + make install + pip check + ocrd resmgr download ocrd-kraken-segment blla.mlmodel + ocrd resmgr download ocrd-kraken-recognize en_best.mlmodel + - name: Test + run: | + source venv/bin/activate + make test diff --git a/README.md b/README.md index 31fb4b9..28970e3 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ > OCR-D wrapper for the Kraken OCR engine +[![CI](https://github.com/OCR-D/ocrd_kraken/actions/workflows/ci.yml/badge.svg)](https://github.com/OCR-D/ocrd_kraken/actions/workflows/ci.yml) [![Docker Automated build](https://img.shields.io/docker/automated/ocrd/kraken.svg)](https://hub.docker.com/r/ocrd/kraken/tags/) [![image](https://circleci.com/gh/OCR-D/ocrd_kraken.svg?style=svg)](https://circleci.com/gh/OCR-D/ocrd_kraken)