-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (62 loc) · 1.98 KB
/
test.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
name: Linting & Test
on:
push
env:
PYTHON_VERSION: 3.11.5
POETRY_VERSION: 1.8.2
jobs:
linting:
name: Check Linting & Types
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: abatilo/actions-poetry@v3
with:
poetry-version: ${{ env.POETRY_VERSION }}
- run: poetry install
- name: ruff check
run: poetry run ruff check
- name: ruff format
run: poetry run ruff format --check
version:
name: Test Version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
project_name="$(grep --color=never 'name *= *".*"' pyproject.toml)"
project_name="${project_name%\"}"
project_name="${project_name#*\"}"
version_project="$(grep --color=never 'version *= *".*"' pyproject.toml)"
version_project="${version_project%\"}"
version_project="${version_project#*\"}"
version_package="$(grep --color=never '__version__ *= *".*"' "$project_name"/__version__.py)"
version_package="${version_package%\"}"
version_package="${version_package#*\"}"
test "$version_project" = "$version_package"
pytest:
name: pytest
runs-on: ubuntu-latest
needs:
- linting
- version
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: abatilo/actions-poetry@v3
with:
poetry-version: ${{ env.POETRY_VERSION }}
- uses: actions/setup-go@v5
- run: poetry install
- run: go install github.com/richardlehane/siegfried/cmd/sf@latest
- name: pytest
env:
GOPATH: /home/runner/go
run: poetry run coverage run -m pytest
- name: coverage
run: poetry run coverage report -m --fail-under=80 --skip-empty --skip-covered