Skip to content

v0.1.7: fix: skip CI/release on template repo, list all funding platf… #10

v0.1.7: fix: skip CI/release on template repo, list all funding platf…

v0.1.7: fix: skip CI/release on template repo, list all funding platf… #10

Workflow file for this run

name: CI
on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]
jobs:
test:
# Skip on the template repo itself (no pyproject.toml until instantiated)
if: github.repository != 'DazzleTools/git-repokit-template'
runs-on: windows-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Cache dependencies
uses: actions/cache@v5
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -e ".[dev]"
- name: Lint with flake8
run: |
pip install flake8
# Auto-detect the Python package directory
PKG_DIR=$(python -c "import pathlib; dirs=[d for d in pathlib.Path('.').iterdir() if d.is_dir() and (d / '__init__.py').exists() and not d.name.startswith('.')]; print(dirs[0] if dirs else '.')")
echo "Linting: $PKG_DIR"
# Stop the build if there are Python syntax errors or undefined names
flake8 "$PKG_DIR"/ --count --select=E9,F63,F7,F82 --show-source --statistics
# Exit-zero treats all errors as warnings
flake8 "$PKG_DIR"/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
continue-on-error: true
- name: Run tests
run: |
python -m pytest tests/ -v
build:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v6
- name: Set up Python 3.11
uses: actions/setup-python@v6
with:
python-version: 3.11
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build wheel
- name: Build package
run: |
python -m build
- name: Check package
run: |
pip install twine
twine check dist/*