Skip to content

Fix CI: drop uv venv, setup-uv already creates the venv #9

Fix CI: drop uv venv, setup-uv already creates the venv

Fix CI: drop uv venv, setup-uv already creates the venv #9

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
tags:
- 'v*'
pull_request:
branches: [ main, develop ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: uv pip install -e ".[dev]"
- name: Format check (Ruff)
run: uv run ruff format --check src/
- name: Lint (Ruff)
run: uv run ruff check src/
- name: Type check (ty)
run: uv run ty check src/
- name: Test with pytest
run: |
uv run pytest --cov=src/makefolio --cov-report=xml --cov-report=term || echo "No tests found, skipping"
continue-on-error: true
- name: Upload coverage to Codecov
if: matrix.python-version == '3.12'
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
fail_ci_if_error: false
continue-on-error: true
build:
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
- name: Install build dependencies
run: uv pip install build twine
- name: Build package
run: uv run python -m build
- name: Check package
run: uv run twine check dist/*
publish:
runs-on: ubuntu-latest
needs: [test, build]
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
- name: Install build dependencies
run: uv pip install build twine
- name: Build package
run: uv run python -m build
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: uv run twine upload dist/*