CI demo: metrics + Gitea Actions
This commit is contained in:
15
workflows_заготовки/bad.yml
Normal file
15
workflows_заготовки/bad.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
# ВНИМАНИЕ: демонстрационно плохой workflow — только для учебного репозитория!
|
||||
# Используется в бонусном акте: показать «декоративный» CI (|| true).
|
||||
name: mega
|
||||
|
||||
on: pull_request
|
||||
|
||||
jobs:
|
||||
everything:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: pip install -r requirements.txt
|
||||
- run: ruff check . || true
|
||||
- run: pytest -q || true
|
||||
- run: echo "deploy --token=ghp_xxxxxxxxxxxxxxxxxxxx"
|
||||
26
workflows_заготовки/ci-artifacts.yml
Normal file
26
workflows_заготовки/ci-artifacts.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
# Заготовка для акта «Артефакты» (Gitea Actions): скопировать поверх .gitea/workflows/ci.yml
|
||||
# upload-artifact@v3 — максимально совместим с Gitea Actions;
|
||||
# на новых версиях Gitea можно заменить на @v4.
|
||||
name: CI (artifacts)
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
cache: pip
|
||||
- run: pip install -r requirements.txt
|
||||
- run: pytest -q --cov=app --cov-branch --cov-fail-under=60 --cov-report=xml
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
with:
|
||||
name: coverage-report
|
||||
path: coverage.xml
|
||||
23
workflows_заготовки/ci-matrix.yml
Normal file
23
workflows_заготовки/ci-matrix.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
# Заготовка для акта «Матрица» (Gitea Actions): скопировать поверх .gitea/workflows/ci.yml
|
||||
name: CI (matrix)
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version: ["3.11", "3.12", "3.13"]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
cache: pip
|
||||
- run: pip install -r requirements.txt
|
||||
- run: pytest -q
|
||||
43
workflows_заготовки/ci-metrics-strict.yml
Normal file
43
workflows_заготовки/ci-metrics-strict.yml
Normal file
@@ -0,0 +1,43 @@
|
||||
name: CI (strict metrics)
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
cache: pip
|
||||
- run: pip install -r requirements.txt
|
||||
- run: ruff check .
|
||||
|
||||
test:
|
||||
needs: lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
cache: pip
|
||||
- run: pip install -r requirements.txt
|
||||
- run: pytest -q --cov=app --cov-branch --cov-fail-under=60
|
||||
|
||||
metrics:
|
||||
needs: test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
cache: pip
|
||||
- run: pip install -r requirements.txt
|
||||
- run: radon cc app -s -a
|
||||
- run: xenon --max-absolute B app/
|
||||
Reference in New Issue
Block a user