1.7 KiB
1.7 KiB
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, orpyproject.tomlexists - Actions:
- Set up Python 3.x
pip install -r requirements.txt(if present)- Install dev tools: ruff, black, flake8, pytest
- Lint: Run ruff, black --check, and flake8 (each skipped if not installed)
- Test: Run pytest (only if
tests/dir or pytest config detected)
Node.js Detection
- Trigger:
package.jsonexists - Actions:
- Set up Node.js (LTS)
npm ci- Lint:
npm run lint(only if "lint" script exists in package.json) - Test:
npm test(only if "test" script exists) - 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.):
- Add a detection step similar to the Python/Node checks.
- Add setup, lint, and test steps conditional on detection.
- Follow the same CI_STRICT pattern for error handling.