Add Gitea Actions CI for all branches #2

Merged
patrick merged 2 commits from ci/gitea-actions into main 2026-10-15 00:53:40 +00:00
2 changed files with 44 additions and 0 deletions
Showing only changes of commit b236611044 - Show all commits

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
name: CI
on:
push:
branches:
- "**"
pull_request:
branches:
- "**"
workflow_dispatch:
jobs:
test:
name: Unit tests
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out repository
uses: https://github.com/actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python
uses: https://github.com/actions/setup-python@v5
with:
python-version: "3.12"
- name: Run unit tests
run: python3 -m unittest discover -s tests -v
+14
View File
@@ -258,6 +258,20 @@ python3 agent.py --doctor
---
## Tests
Run the unit tests from the repository root:
```bash
python3 -m unittest discover -s tests -v
```
The tests use Python's standard library and mock external system commands. They do not require CrowdSec, `nftables`, elevated privileges, or additional Python packages.
[Gitea Actions](.gitea/workflows/ci.yaml) runs the same command with Python 3.12 on an `ubuntu-latest` runner for pushes to any branch, pull requests targeting any branch, and manual runs. Repository Actions must be enabled and a runner with that label must be available.
---
## Configuration
Configuration precedence: