Added python workflow

This commit is contained in:
2024-11-13 18:18:29 +00:00
parent 8128e6083f
commit 7d9b72327f

39
.github/workflows/python-package.yaml vendored Normal file
View File

@@ -0,0 +1,39 @@
name: Python package
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build-python:
runs-on: [ubuntu-latest, windows-latest, macos-latest]
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Act dependencies
if: ${{ env.ACT }}
run: |
apt-get update && apt-get install sudo -y cargo
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Build rust package
run: |
maturin build
python -m pip install target/wheels/*.whl
- name: Test with pytest
run: |
pytest