-
Notifications
You must be signed in to change notification settings - Fork 13
49 lines (47 loc) · 1.53 KB
/
checks.yaml
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
name: checks
on:
- push
- pull_request
jobs:
ruff:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.11'
- run: python -m pip install ruff
- run: ruff check beanquery/
coverage:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.11'
- run: pip install -r requirements.txt coverage
- name: Run coverage
# Check tests coverage. Instead of checking project coverage of
# all the tests we check that each module is exaustively tested
# by the dedicated units tests.
run: |
set -x
echo '{
"beanquery/parser/*": "beanquery/parser_test.py",
"beanquery/query_render.py": "beanquery/query_render_test.py"
}' | jq -rc 'to_entries | .[] | (.key + "=" + .value)' | while IFS='=' read src test
do
python -m coverage run --branch --include "$src" --omit beanquery/parser/parser.py -m unittest "$test"
python -m coverage report --fail-under=100 -m
python -m coverage erase
done
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.11'
- run: pip install -r requirements.txt wheel build
- run: python -m build --no-isolation
- run: python -m pip install dist/beanquery-*.whl