-
Notifications
You must be signed in to change notification settings - Fork 5
91 lines (84 loc) · 2.78 KB
/
python-app.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# 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:
branches: [ "master" ]
pull_request:
workflow_dispatch:
inputs:
upterm-session:
description: 'Run SSH login server for debugging'
default: False
type: boolean
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: Setup upterm session
# interactive SSH logins for debugging
if: github.event.inputs.upterm-session == 'true'
uses: lhotari/action-upterm@v1
- name: Install dependencies
run: make deps
- 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-detectron2-segment/*
- name: Install dependencies for test
# also downloads models, if not already present
run: make deps-test
- name: Run tests
run: make test
- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: test-results
path: |
./test/assets/*/data/test-result
./test/assets/*/data/OCR-D-SEG-*/
if-no-files-found: error
publish:
permissions:
# for stefanzweifel/git-auto-commit-action to push code on gh-pages
contents: write
needs: build
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout GH Pages
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
with:
ref: gh-pages
- name: Download Artifact
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: test-results
path: test-results
- name: Data Ingest
run: bash gen-test-results-table.sh
- name: Commit
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: new test results from ${{ github.sha }}
branch: gh-pages
# file_pattern: test-results*
repository: .