Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7fa51bda6b | ||
|
|
99d8002e27 | ||
|
|
5731fc8a02 |
@@ -71,12 +71,12 @@ jobs:
|
||||
|
||||
- name: Ruff (lint + format check)
|
||||
run: |
|
||||
uv run ruff check src/ tests/
|
||||
uv run ruff format --check src/ tests/
|
||||
uv run ruff check
|
||||
uv run ruff format --check
|
||||
|
||||
- name: MyPy
|
||||
run: |
|
||||
uv run mypy src/ tests/
|
||||
uv run mypy .
|
||||
- name: Pytest
|
||||
run: |
|
||||
uv run pytest tests/ --cov=src/quickbot_cli --cov-report=term-missing --cov-report=html -v
|
||||
|
||||
@@ -10,8 +10,12 @@ on:
|
||||
|
||||
jobs:
|
||||
build-publish:
|
||||
# Only run on pre-releases (alpha, beta, rc)
|
||||
if: contains(gitea.ref, 'rc') || contains(gitea.ref, 'a') || contains(gitea.ref, 'b')
|
||||
# Only run on pre-releases (alpha, beta, rc, dev)
|
||||
# This workflow handles: v0.1.0rc1, v1.0.0a1, v2.3.4b2, v0.1.0dev1, etc.
|
||||
# IMPORTANT: This should NEVER run for stable releases like v0.1.0
|
||||
# Use more specific patterns to avoid matching normal version numbers
|
||||
# Pattern: rc (release candidate), a followed by number (alpha), b followed by number (beta), dev
|
||||
if: contains(gitea.ref_name, 'rc') || contains(gitea.ref_name, 'a') || contains(gitea.ref_name, 'b') || contains(gitea.ref_name, 'dev')
|
||||
|
||||
permissions:
|
||||
id-token: write
|
||||
@@ -26,6 +30,23 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Debug release info
|
||||
run: |
|
||||
echo "🔍 Release Debug Information:"
|
||||
echo "Tag/Ref: ${{ gitea.ref }}"
|
||||
echo "Tag name: ${{ gitea.ref_name }}"
|
||||
echo "Repository: ${{ gitea.repository }}"
|
||||
echo "Event type: ${{ gitea.event_name }}"
|
||||
echo "Workflow: TestPyPI"
|
||||
|
||||
echo ""
|
||||
echo "📋 Condition Check:"
|
||||
echo "Contains 'rc': ${{ contains(gitea.ref_name, 'rc') }}"
|
||||
echo "Contains 'a': ${{ contains(gitea.ref_name, 'a') }}"
|
||||
echo "Contains 'b': ${{ contains(gitea.ref_name, 'b') }}"
|
||||
echo "Contains 'dev': ${{ contains(gitea.ref_name, 'dev') }}"
|
||||
echo "Should run: ${{ contains(gitea.ref_name, 'rc') || contains(gitea.ref_name, 'a') || contains(gitea.ref_name, 'b') || contains(gitea.ref_name, 'dev') }}"
|
||||
- name: Set up uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
|
||||
@@ -10,8 +10,10 @@ on:
|
||||
|
||||
jobs:
|
||||
build-publish:
|
||||
# Only run on stable releases (not alpha, beta, rc)
|
||||
if: "!contains(gitea.ref, 'rc') && !contains(gitea.ref, 'a') && !contains(gitea.ref, 'b')"
|
||||
# Only run on stable releases (not alpha, beta, rc, dev)
|
||||
# This workflow handles: v0.1.0, v1.0.0, v2.3.4, etc.
|
||||
# IMPORTANT: This should be the ONLY workflow that runs for stable releases
|
||||
if: "!contains(gitea.ref_name, 'rc') && !contains(gitea.ref_name, 'a') && !contains(gitea.ref_name, 'b') && !contains(gitea.ref_name, 'dev')"
|
||||
|
||||
permissions:
|
||||
id-token: write
|
||||
@@ -25,6 +27,23 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Debug release info
|
||||
run: |
|
||||
echo "🔍 Release Debug Information:"
|
||||
echo "Tag/Ref: ${{ gitea.ref }}"
|
||||
echo "Tag name: ${{ gitea.ref_name }}"
|
||||
echo "Repository: ${{ gitea.repository }}"
|
||||
echo "Event type: ${{ gitea.event_name }}"
|
||||
echo "Workflow: Production PyPI"
|
||||
|
||||
echo ""
|
||||
echo "📋 Condition Check:"
|
||||
echo "Contains 'rc': ${{ contains(gitea.ref_name, 'rc') }}"
|
||||
echo "Contains 'a': ${{ contains(gitea.ref_name, 'a') }}"
|
||||
echo "Contains 'b': ${{ contains(gitea.ref_name, 'b') }}"
|
||||
echo "Contains 'dev': ${{ contains(gitea.ref_name, 'dev') }}"
|
||||
echo "Should run: ${{ !contains(gitea.ref_name, 'rc') && !contains(gitea.ref_name, 'a') && !contains(gitea.ref_name, 'b') && !contains(gitea.ref_name, 'dev') }}"
|
||||
- name: Set up uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
repos:
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
rev: v0.12.10
|
||||
rev: v0.12.12
|
||||
hooks:
|
||||
- id: ruff-check
|
||||
args: ["--fix"]
|
||||
@@ -26,6 +26,6 @@ repos:
|
||||
hooks:
|
||||
- id: codespell
|
||||
- repo: https://github.com/fsfe/reuse-tool
|
||||
rev: v5.0.2
|
||||
rev: v5.1.1
|
||||
hooks:
|
||||
- id: reuse
|
||||
@@ -18,10 +18,9 @@ authors = [
|
||||
]
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.13"
|
||||
license = { text = "MIT" }
|
||||
license = { text = "Apache-2.0" }
|
||||
dependencies = [
|
||||
"typer",
|
||||
"quickbot>=0.1.1",
|
||||
"jinja2",
|
||||
"pyyaml",
|
||||
]
|
||||
@@ -62,12 +61,6 @@ python_version = "3.13"
|
||||
strict = true
|
||||
ignore_missing_imports = true
|
||||
warn_unused_ignores = true
|
||||
exclude = [
|
||||
"test_cli_output/",
|
||||
"dist/",
|
||||
".venv/",
|
||||
".mypy_cache/"
|
||||
]
|
||||
|
||||
[tool.hatch.version]
|
||||
source = "vcs"
|
||||
|
||||
@@ -4,16 +4,16 @@
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# Local CI script to test the same steps as the Gitea workflow
|
||||
# Local CI script to run all checks and a packaging/CLI smoke test
|
||||
set -e
|
||||
|
||||
echo "🚀 Running local CI tests..."
|
||||
echo "🚀 Running local CI checks and smoke tests..."
|
||||
|
||||
echo "📦 Installing dependencies..."
|
||||
uv sync --all-extras --dev
|
||||
|
||||
echo "🔍 Running Ruff linting..."
|
||||
uv run ruff check .
|
||||
uv run ruff check
|
||||
|
||||
echo "🎨 Checking code formatting..."
|
||||
uv run ruff format --check
|
||||
@@ -27,4 +27,36 @@ uv run reuse lint
|
||||
echo "🧪 Running tests..."
|
||||
uv run pytest
|
||||
|
||||
echo "✅ All checks passed!"
|
||||
echo "🧪 Testing CI workflow steps locally (package build and CLI)..."
|
||||
|
||||
echo "📦 Building package..."
|
||||
uv build
|
||||
|
||||
echo "🔧 Testing package installation..."
|
||||
uv pip install dist/*.whl
|
||||
|
||||
echo "❓ Testing help command..."
|
||||
uv run quickbot --help
|
||||
|
||||
echo "🚀 Testing CLI functionality..."
|
||||
mkdir -p test_cli_output
|
||||
uv run quickbot init \
|
||||
--output test_cli_output \
|
||||
--project-name "Local Test" \
|
||||
--description "Local Test Description" \
|
||||
--author "Local Test" \
|
||||
--license-name MIT \
|
||||
--no-include-alembic \
|
||||
--no-include-i18n \
|
||||
--no-interactive
|
||||
|
||||
echo "📁 Checking generated files..."
|
||||
ls -la test_cli_output/
|
||||
echo "📄 Generated pyproject.toml:"
|
||||
cat test_cli_output/pyproject.toml
|
||||
|
||||
echo "🧹 Cleaning up..."
|
||||
rm -rf test_cli_output
|
||||
rm -rf dist/*
|
||||
|
||||
echo "✅ All checks and smoke tests passed!"
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# SPDX-FileCopyrightText: 2025 Alexander Kalinovsky <a@k8y.ru>
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# Test CI workflow steps locally
|
||||
set -e
|
||||
|
||||
echo "🧪 Testing CI workflow steps locally..."
|
||||
|
||||
echo "📦 Building package..."
|
||||
uv build
|
||||
|
||||
echo "🔧 Testing package installation..."
|
||||
uv pip install dist/*.whl
|
||||
|
||||
echo "❓ Testing help command..."
|
||||
uv run quickbot --help
|
||||
|
||||
echo "🚀 Testing CLI functionality..."
|
||||
mkdir -p test_cli_output
|
||||
uv run quickbot init \
|
||||
--output test_cli_output \
|
||||
--project-name "Local Test" \
|
||||
--description "Local Test Description" \
|
||||
--author "Local Test" \
|
||||
--license-name MIT \
|
||||
--no-include-alembic \
|
||||
--no-include-i18n \
|
||||
--no-interactive
|
||||
|
||||
echo "📁 Checking generated files..."
|
||||
ls -la test_cli_output/
|
||||
echo "📄 Generated pyproject.toml:"
|
||||
cat test_cli_output/pyproject.toml
|
||||
|
||||
echo "🧹 Cleaning up..."
|
||||
rm -rf test_cli_output
|
||||
rm -rf dist/*
|
||||
|
||||
echo "✅ All CI workflow steps passed locally!"
|
||||
Reference in New Issue
Block a user