From 9a6730ef3aa5cc2b77c25e453cc627b25188700d Mon Sep 17 00:00:00 2001 From: Robert Sachunsky Date: Wed, 12 Apr 2023 22:58:33 +0200 Subject: [PATCH] add CI :fingers_crossed: --- .github/workflows/test.yml | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..4146b0c --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,41 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: CLI Tests + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.7', '3.8', '3.9'] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Lint with flake8 + run: | + pip install flake8 + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Install package + run: make install + - name: Cache models + uses: actions/cache@v3 + with: + key: detectron-models + path: /home/runner/.local/share/ocrd-resources/ocrd-sbb-binarize/* + - name: Install dependencies for test + # also downloads models, if not already present + run: make models test/assets + - name: Run tests + run: make test +