55 lines
1.1 KiB
YAML
55 lines
1.1 KiB
YAML
name: Build Python Package
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
container: catthehacker/ubuntu:act-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.13.1"
|
|
cache: "pip"
|
|
|
|
- name: Install and configure Poetry
|
|
uses: snok/install-poetry@v1
|
|
with:
|
|
virtualenvs-create: false
|
|
installer-parallel: true
|
|
|
|
- name: Validate the structure of the pyproject.toml
|
|
run: |
|
|
poetry check
|
|
|
|
- name: Verify that poetry.lock is consistent with pyproject.toml
|
|
run: |
|
|
poetry lock --check
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
poetry install
|
|
|
|
- name: Check code formatting by black
|
|
run: |
|
|
poetry run black . --check
|
|
|
|
- name: Lint code by ruff
|
|
run: |
|
|
poetry run ruff .
|
|
|
|
- name: Check types by pyright
|
|
run: |
|
|
poetry run pyright
|
|
|
|
- name: Build package
|
|
run: poetry build
|