Skip to content

Commit

Permalink
Merge pull request #41 from stweil/master
Browse files Browse the repository at this point in the history
Replace old Travis CI by GitHub action
  • Loading branch information
kba authored Oct 15, 2023
2 parents a5c72be + 994204a commit 4b3cc79
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 11 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ help:
@echo ""
@echo " deps Install python deps via pip"
@echo " deps-test Install testing deps via pip"
@echo " deps-ubuntu Install required packages for Debian/Ubuntu"
@echo " install Install"
@echo " install-dev Install in editable mode"
@echo " docker Build Docker image"
Expand All @@ -37,8 +38,10 @@ deps:
$(PIP) install -r requirements.txt

deps-ubuntu:
ifeq ($(shell type -p apt-get), /usr/bin/apt-get)
apt-get update
apt-get -y install libprotobuf-dev protobuf-compiler libpng-dev libeigen3-dev
endif

# Install testing deps via pip
deps-test:
Expand Down Expand Up @@ -69,12 +72,12 @@ test: tests/assets
# Clone OCR-D/assets to ./repo/assets
repo/assets:
mkdir -p $(dir $@)
git clone https://github.com/OCR-D/assets "$@"
git clone --quiet https://github.com/OCR-D/assets "$@"


# Setup test assets
tests/assets: repo/assets
mkdir -p tests/assets
cp -r -t tests/assets repo/assets/data/*
cp -a repo/assets/data/* tests/assets

.PHONY: docker install install-dev deps deps-ubuntu deps-test test help
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

> OCR-D wrapper for the Kraken OCR engine
[![image](https://travis-ci.org/OCR-D/ocrd_kraken.svg?branch=master)](https://travis-ci.org/OCR-D/ocrd_kraken)
[![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)

Expand Down

0 comments on commit 4b3cc79

Please sign in to comment.