Skip to content

Workflow file for this run

name: Build and Test Python Wheel
on:
push:
branches: ["feature/poetry"]
pull_request:
branches: ["feature/poetry"]
workflow_dispatch:
jobs:
build-wheel:
runs-on: ubuntu-latest
env:
POETRY_VERSION: "1.8.2"
PYTHON_VERSION: "3.11"
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Get full Python version
id: full-python-version
run: |
echo "version=$(python -c 'import sys; print("-".join(str(v) for v in sys.version_info[:3]))')" >> $GITHUB_OUTPUT
- name: Bootstrap poetry
run: |
curl -sSL https://install.python-poetry.org | POETRY_VERSION=${{ env.POETRY_VERSION }} python -
- name: Update PATH (Linux and macOS)
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Configure poetry
run: poetry config virtualenvs.in-project true
- name: Set up cache
uses: actions/cache@v3
id: cache
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
run: timeout 10s poetry run pip --version || rm -rf .venv
- name: Make build script executable
run: chmod +x ./.github/scripts/build.sh
- name: Build Wheel
run: |
./.github/scripts/build.sh
WHEEL_FILE=$(ls dist/*.whl)
echo "WHEEL_FILE=${WHEEL_FILE}" >> $GITHUB_ENV
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: built-wheel
path: dist/*.whl
test-wheel:
needs: build-wheel
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: