fix: fix woodpecker pipelines
This commit is contained in:
21
.woodpecker/comment_pr.yaml
Normal file
21
.woodpecker/comment_pr.yaml
Normal file
@@ -0,0 +1,21 @@
|
||||
pipeline:
|
||||
comment:
|
||||
image: mcs94/gitea-comment
|
||||
settings:
|
||||
gitea_address: https://git.pyaqa.ru
|
||||
gitea_token:
|
||||
from_secret: gitea_token
|
||||
comment: >
|
||||
✅ Build ${CI_BUILD_EVENT} of `${CI_REPO_NAME}` has status `${CI_BUILD_STATUS}`.
|
||||
|
||||
📝 Commit by ${CI_COMMIT_AUTHOR} on `${CI_COMMIT_BRANCH}`:
|
||||
|
||||
`${CI_COMMIT_MESSAGE}`
|
||||
|
||||
🌐 ${CI_BUILD_LINK}
|
||||
when:
|
||||
event: [pull_request]
|
||||
depends_on:
|
||||
- lint
|
||||
- type
|
||||
- test
|
||||
@@ -1,18 +0,0 @@
|
||||
when:
|
||||
event: [push]
|
||||
branch: main
|
||||
|
||||
steps:
|
||||
deploy:
|
||||
image: python:3.13
|
||||
commands:
|
||||
- echo "🚀 Deploying to production..."
|
||||
- echo "Branch: main"
|
||||
- echo "Commit: $(git rev-parse --short HEAD)"
|
||||
# Add your deployment commands here
|
||||
# Example:
|
||||
# - uv sync --frozen
|
||||
# - uv run python -m app.main &
|
||||
- echo "✅ Deployment complete"
|
||||
when:
|
||||
status: [success]
|
||||
@@ -1,49 +0,0 @@
|
||||
when:
|
||||
event: [push, pull_request]
|
||||
|
||||
steps:
|
||||
check-branch:
|
||||
image: alpine/git
|
||||
commands:
|
||||
- BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||
- |
|
||||
echo "Branch: $BRANCH"
|
||||
if [ "$BRANCH" = "main" ]; then
|
||||
echo "✓ Production branch (protected)"
|
||||
elif [ "$BRANCH" = "dev" ]; then
|
||||
echo "✓ Development branch (protected)"
|
||||
elif echo "$BRANCH" | grep -qE "^feature/"; then
|
||||
echo "✓ Feature branch"
|
||||
elif echo "$BRANCH" | grep -qE "^(fix|hotfix|release)/"; then
|
||||
echo "✓ Special branch"
|
||||
else
|
||||
echo "⚠️ Unusual branch name: $BRANCH"
|
||||
echo " Recommended: feature/<description>, fix/<description>"
|
||||
fi
|
||||
|
||||
check-commit-message:
|
||||
image: alpine/git
|
||||
commands:
|
||||
- MSG=$(git log -1 --pretty=%s)
|
||||
- |
|
||||
echo "Last commit: $MSG"
|
||||
if echo "$MSG" | grep -qE "^(feat|fix|docs|style|refactor|test|chore): [a-z]"; then
|
||||
echo "✓ Commit message follows convention"
|
||||
else
|
||||
echo "❌ Invalid commit message format"
|
||||
echo " Expected: <type>: <description>"
|
||||
echo " Types: feat, fix, docs, style, refactor, test, chore"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
check-cache-files:
|
||||
image: python:3.13
|
||||
commands:
|
||||
- |
|
||||
CACHE_FILES=$(git diff --name-only HEAD~1 | grep -E "__pycache__|\.pyc$" || true)
|
||||
if [ -n "$CACHE_FILES" ]; then
|
||||
echo "❌ Cache files in commit:"
|
||||
echo "$CACHE_FILES"
|
||||
exit 1
|
||||
fi
|
||||
- echo "✓ No cache files in commit"
|
||||
@@ -1,6 +1,6 @@
|
||||
when:
|
||||
- event: [push, pull_request]
|
||||
branch: main
|
||||
branch: dev
|
||||
|
||||
steps:
|
||||
- name: lint
|
||||
@@ -11,3 +11,4 @@ steps:
|
||||
- uv run black --check .
|
||||
- uv run ruff check .
|
||||
- uv run isort --check-only .
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
when:
|
||||
- event: [push, pull_request]
|
||||
branch: main
|
||||
branch: dev
|
||||
|
||||
steps:
|
||||
- name: tests
|
||||
- name: test
|
||||
image: python:3.11
|
||||
commands:
|
||||
- pip install uv
|
||||
- uv sync --no-dev --group tests
|
||||
- uv run pytest --cov=app --cov-fail-under=70 --cov-report=term-missing
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
when:
|
||||
- event: [push, pull_request]
|
||||
branch: main
|
||||
branch: dev
|
||||
|
||||
steps:
|
||||
- name: types
|
||||
- name: type
|
||||
image: python:3.11
|
||||
commands:
|
||||
- pip install uv
|
||||
Reference in New Issue
Block a user