Merge pull request #1 from TechNickAI/add-claude-github-actions-17484… #27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Test | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
workflow_dispatch: # Allow manual triggering | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.13" | |
- uses: pre-commit/action@v3.0.1 | |
build-python: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.8", "3.13"] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Cache pip dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('python/pyproject.toml') }} | |
restore-keys: | | |
${{ runner.os }}-pip-${{ matrix.python-version }}- | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: | | |
python -m pip install pytest pytest-cov build | |
cd python | |
python -m pip install -e . | |
- name: Run tests with coverage | |
run: | | |
cd python | |
pytest --cov=heart_centered_prompts --cov-report=term | |
- name: Build package | |
run: | | |
cd python | |
python -m build | |
- name: Verify package installable | |
run: | | |
cd python | |
python -m pip install dist/*.whl | |
python -c "import heart_centered_prompts; print(f'Successfully imported version: {heart_centered_prompts.__version__}')" | |
- name: Run tests against installed wheel | |
run: | | |
cd python | |
python -m pip uninstall -y heart_centered_prompts | |
python -m pip install dist/*.whl | |
pytest --pyargs heart_centered_prompts | |
- name: Upload package artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: python-package-${{ matrix.python-version }} | |
path: python/dist/ | |
retention-days: 7 | |
if-no-files-found: error | |
build-javascript: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "22" | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 10 | |
run_install: false | |
- name: Install dependencies | |
run: | | |
# Uncomment when JavaScript package is implemented | |
# cd javascript | |
# pnpm install | |
- name: Run tests | |
run: | | |
# Uncomment when JavaScript tests are implemented | |
# cd javascript | |
# pnpm test | |
echo "JavaScript tests placeholder - to be implemented" |