Skip to content

gh action: build python packages for different archs #55

gh action: build python packages for different archs

gh action: build python packages for different archs #55

name: Python - run test suite
on:
workflow_dispatch:
push:
branches:
- 'main'
paths:
- 'python/**'
- 'tests_data/**'
- '.github/workflows/**'
pull_request:
paths:
- 'python/**'
- 'tests_data/**'
- '.github/workflows/**'
permissions:
contents: read
jobs:
unit-testing:
strategy:
matrix:
python-version: [ "3.8.x", "3.9.x", "3.10.x", "3.11.x", "3.12.x" ]
os: [ "ubuntu-latest", "macos-latest" ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # pin@v4
- name: Setup Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # pin@v5
with:
python-version: '${{ matrix.python-version }}'
- name: Install uv
run: curl -LsSf https://astral.sh/uv/0.4.7/install.sh | sh
- name: Install all projects dependencies (with the requested python version)
working-directory: python
run: uv sync --python $(which python3) --all-extras --dev
- name: Run ruff check
working-directory: python
run: uv run --python $(which python3) ruff check --verbose
- name: Run ruff format --check
working-directory: python
run: uv run --python $(which python3) ruff format --check --verbose
- name: Run mypy
working-directory: python
run: uv run --python $(which python3) mypy src/magika tests
- name: Run the python tests suite
working-directory: python
run: uv run --python $(which python3) pytest tests -m "not slow"