Add Gitea Actions workflows, CI config, and docs
Some checks failed
Docker / docker (push) Successful in 6s
Security / security (push) Successful in 6s
Deploy / deploy-local-runner (push) Has been cancelled
CI / ci (push) Successful in 1m42s
Deploy / deploy-ssh (push) Successful in 7s

This commit is contained in:
2026-02-28 20:40:14 +01:00
parent 3b48b39561
commit 8cadb2d216
35 changed files with 3216 additions and 0 deletions

52
docs/CI.md Normal file
View File

@@ -0,0 +1,52 @@
# CI Pipeline — ${REPO_NAME}
## Overview
The CI workflow (`.gitea/workflows/ci.yml`) runs on every push and pull request.
It auto-detects the project type and runs the appropriate tools.
## Detection Logic
The workflow checks for project files in this order:
### Python Detection
- **Trigger**: `requirements.txt`, `setup.py`, or `pyproject.toml` exists
- **Actions**:
1. Set up Python 3.x
2. `pip install -r requirements.txt` (if present)
3. Install dev tools: ruff, black, flake8, pytest
4. **Lint**: Run ruff, black --check, and flake8 (each skipped if not installed)
5. **Test**: Run pytest (only if `tests/` dir or pytest config detected)
### Node.js Detection
- **Trigger**: `package.json` exists
- **Actions**:
1. Set up Node.js (LTS)
2. `npm ci`
3. **Lint**: `npm run lint` (only if "lint" script exists in package.json)
4. **Test**: `npm test` (only if "test" script exists)
5. **Build**: `npm run build` (only if "build" script exists)
### No Project Detected
- If neither Python nor Node.js files are found, the workflow prints a message
and exits successfully. **It never fails due to missing language detection.**
## Strict Mode
Controlled by `CI_STRICT` in `.ci/config.env`:
| CI_STRICT | Behavior |
|-----------|----------|
| `true` (default) | Lint/test failures cause the workflow to fail |
| `false` | Failures are logged as warnings; workflow succeeds |
Use `CI_STRICT=false` during early development when you want visibility
into issues without blocking merges.
## Adding Support for Other Languages
To add support for another language (Go, Rust, etc.):
1. Add a detection step similar to the Python/Node checks.
2. Add setup, lint, and test steps conditional on detection.
3. Follow the same CI_STRICT pattern for error handling.