Skip to content

Deploy only the compiled packages. #13

Deploy only the compiled packages.

Deploy only the compiled packages. #13

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: build
on:
push:
branches: [ main ]
paths:
- "src/**"
- "tinybpe/**"
- "tests/**"
- "setup.py"
- "build_setup.py"
- ".github/workflows/python-package.yml"
pull_request:
paths:
- "src/**"
- "tinybpe/**"
- "tests/**"
- "setup.py"
- "build_setup.py"
- ".github/workflows/python-package.yml"
schedule:
- cron: '0 10 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
os: [ubuntu-latest, macos-latest, macos-13, windows-latest]
exclude:
- python-version: '3.9'
os: macos-latest
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
# This is necessary to get the PR head instead of base
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements_dev.txt
- name: Build dist
if: matrix.os != 'windows-latest'
run: |
python -m build
pip install dist/*.whl
- name: Build dist on Windows
if: matrix.os == 'windows-latest'
run: |
python -m build
pip install (Get-ChildItem dist/*.whl)
- name: Test with pytest
run: |
python build_setup.py build_ext
python -m pytest
- name: Generate coverage report
run: |
pytest --cov --cov-branch --cov-report=xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: neluca/tinybpe