Skip to content

Commit 6eb1eeb

Browse files
add: github workflow
1 parent cf4c53c commit 6eb1eeb

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/build.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: apertium-python CI Build
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
python-version: [3.6, 3.7, 3.8]
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up Python ${{ matrix.python-version }}
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install pipenv
23+
python3 setup.py install
24+
pipenv install --dev --system
25+
- name: Flake8 checks
26+
run: |
27+
flake8 --verbose apertium
28+
- name: mypy checks
29+
run: |
30+
mypy apertium --strict --any-exprs-report .mypy_coverage --ignore-missing-imports
31+
cat .mypy_coverage/any-exprs.txt
32+
coverage=$(tail -1 .mypy_coverage/any-exprs.txt | grep -Eo '[0-9\.]+%' | sed 's/%$//')
33+
if (( $(echo "$coverage < 95" | bc -l) )); then
34+
exit 1
35+
fi
36+
- name: code coverage and unittest
37+
run: |
38+
coverage run -m unittest --verbose --buffer tests
39+
coverage report --show-missing --fail-under 90 --include 'apertium/*'

0 commit comments

Comments
 (0)