-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (41 loc) · 1.12 KB
/
python-build.yml
File metadata and controls
52 lines (41 loc) · 1.12 KB
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
name: Python Build
on:
push:
branches: [ main ]
paths:
- 'python/**'
pull_request:
branches: [ main ]
paths:
- 'python/**'
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: python
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install Poetry
run: pip install poetry
- name: Validate pyproject.toml structure
run: poetry check
- name: Regenerate poetry.lock to check sync
run: poetry lock
- name: Fail if poetry.lock is out of sync
run: |
git diff --exit-code poetry.lock || (
echo "::error file=poetry.lock::poetry.lock is not up to date with pyproject.toml. Run 'poetry lock' and commit the result."
exit 1
)
- name: Install dependencies (incl. dev)
run: poetry install --with dev
- name: Lint code
run: poetry run ruff check .
- name: Build package
run: poetry build