-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (91 loc) · 3 KB
/
ci.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
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
92
93
94
95
96
97
98
name: ci
on: [push, pull_request]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
requirements:
# Ubunty latest @ 13-Sep-23:
# Ubuntu 22.04.3 LTS | Python 3.10.12 | Pipx 1.2.0 | No poetry | PostgreSQL 14.9
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: python -m pipx install poetry
- name: Set up Python version from Poetry config
uses: actions/setup-python@v4
with:
python-version-file: 'pyproject.toml'
cache: 'poetry' # caching poetry dependencies
# Warning: poetry cache is not found
- name: Requirements check
run: poetry install --no-interaction
lint:
runs-on: ubuntu-latest
needs: [requirements]
steps:
- uses: actions/checkout@v4
- run: python -m pipx install poetry
- name: Set up Python version from Poetry config
uses: actions/setup-python@v4
with:
python-version-file: 'pyproject.toml'
cache: 'poetry' # caching poetry dependencies
# Warning: poetry cache is not found
- run: poetry install --only dev --no-interaction
- name: Ruff linting
uses: chartboost/ruff-action@v1
with:
args: --config=pyproject.toml
format:
runs-on: ubuntu-latest
needs: [requirements]
steps:
- uses: actions/checkout@v4
- run: python -m pipx install poetry
- name: Set up Python version from Poetry config
uses: actions/setup-python@v4
with:
python-version-file: 'pyproject.toml'
cache: 'poetry' # caching poetry dependencies
# Warning: poetry cache is not found
- run: poetry install --only dev --no-interaction
- name: Black style formatting
uses: psf/black@stable
with:
options: --check --diff --color --config=pyproject.toml
# env:
# CHANGED_FILES: ${{ steps.file_changes.outputs.added_modified }}
test:
runs-on: ubuntu-latest
needs: [lint, format]
steps:
- uses: actions/checkout@v4
- run: python -m pipx install poetry
- name: Set up Python version from Poetry config
uses: actions/setup-python@v4
with:
python-version-file: 'pyproject.toml'
cache: 'poetry' # caching poetry dependencies
# Warning: poetry cache is not found
- run: poetry install --only dev --no-interaction
- name: Unit testing
run: |
python -V
poetry -V
# poetry run pytest
build:
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@v4
- run: python -m pipx install poetry
- name: Set up Python version from Poetry config
uses: actions/setup-python@v4
with:
python-version-file: 'pyproject.toml'
cache: 'poetry' # caching poetry dependencies
# Warning: poetry cache is not found
- run: poetry install
- name: Build
run: |
python -V
poetry -V