docs: add manual runner management workflow to testing documentation

This commit is contained in:
adilallo
2025-08-29 08:24:13 -06:00
parent 9d7e0095f2
commit f87bff4675
5 changed files with 145 additions and 0 deletions
+48
View File
@@ -90,6 +90,17 @@ tests/
└── visual-regression.spec.ts # 23 tests per browser └── visual-regression.spec.ts # 23 tests per browser
``` ```
## 🚀 Runner Management Scripts
```
community-rule/
├── start-runner.sh # Start Gitea Actions runner
├── stop-runner.sh # Stop Gitea Actions runner
├── status-runner.sh # Check runner status
├── config.yaml # Runner configuration
└── act_runner # Gitea Actions runner binary
```
## 🧪 Unit & Integration Testing ## 🧪 Unit & Integration Testing
### Framework ### Framework
@@ -423,6 +434,43 @@ git add .
git commit -m "feat: add new component with tests" git commit -m "feat: add new component with tests"
``` ```
### 2. Manual Runner Management
The Gitea Actions runner is managed manually to save resources and provide control over when CI runs.
#### Start Runner (Before Creating PR)
```bash
# Start the runner to execute CI jobs
./start-runner.sh
```
#### Check Runner Status
```bash
# Check if runner is running and see recent logs
./status-runner.sh
```
#### Stop Runner (After PR Complete)
```bash
# Stop the runner to free up resources
./stop-runner.sh
```
#### Complete PR Workflow
```bash
# 1. Start runner
./start-runner.sh
# 2. Create Pull Request
# Go to repository → New Pull Request
# 3. Monitor CI progress
./status-runner.sh
# Or check Gitea Actions page
# 4. Stop runner when done
./stop-runner.sh
```
### 2. Pull Request Process ### 2. Pull Request Process
1. **Create PR** → CI pipeline starts automatically 1. **Create PR** → CI pipeline starts automatically
+13
View File
@@ -18,6 +18,19 @@ npm run e2e
npm run lhci npm run lhci
``` ```
### Manual Runner Management
```bash
# Start runner (before creating PR)
./start-runner.sh
# Check runner status
./status-runner.sh
# Stop runner (after PR complete)
./stop-runner.sh
```
### Visual Regression ### Visual Regression
```bash ```bash
+23
View File
@@ -0,0 +1,23 @@
#!/bin/bash
echo "🚀 Starting Gitea Actions Runner..."
# Check if runner is already running
if pgrep -f "act_runner daemon" > /dev/null; then
echo "⚠️ Runner is already running!"
echo "To stop it, run: ./stop-runner.sh"
exit 1
fi
# Start the runner in the background
./act_runner daemon --config config.yaml &
RUNNER_PID=$!
# Save PID to file for easy stopping
echo $RUNNER_PID > .runner.pid
echo "✅ Runner started with PID: $RUNNER_PID"
echo "📝 Logs will be written to: runner.log"
echo ""
echo "To stop the runner, run: ./stop-runner.sh"
echo "To check status, run: ./status-runner.sh"
+27
View File
@@ -0,0 +1,27 @@
#!/bin/bash
echo "📊 Gitea Actions Runner Status"
echo "=============================="
# Check if runner is running
if pgrep -f "act_runner daemon" > /dev/null; then
RUNNER_PID=$(pgrep -f "act_runner daemon")
echo "✅ Runner is RUNNING (PID: $RUNNER_PID)"
echo ""
echo "📝 Recent logs:"
if [ -f runner.log ]; then
tail -5 runner.log
else
echo "No log file found"
fi
echo ""
echo "To stop the runner: ./stop-runner.sh"
else
echo "❌ Runner is NOT RUNNING"
echo ""
echo "To start the runner: ./start-runner.sh"
fi
echo ""
echo "🔗 Gitea Actions URL:"
echo "https://git.medlab.host/CommunityRule/community-rule/actions"
Executable
+34
View File
@@ -0,0 +1,34 @@
#!/bin/bash
echo "🛑 Stopping Gitea Actions Runner..."
# Check if PID file exists
if [ -f .runner.pid ]; then
RUNNER_PID=$(cat .runner.pid)
# Check if process is still running
if ps -p $RUNNER_PID > /dev/null; then
echo "🔄 Stopping runner with PID: $RUNNER_PID"
kill $RUNNER_PID
# Wait a moment for graceful shutdown
sleep 2
# Force kill if still running
if ps -p $RUNNER_PID > /dev/null; then
echo "⚡ Force stopping runner..."
kill -9 $RUNNER_PID
fi
echo "✅ Runner stopped successfully"
else
echo "⚠️ Runner process not found (PID: $RUNNER_PID)"
fi
# Clean up PID file
rm -f .runner.pid
else
echo "🔍 No PID file found, checking for any running runners..."
pkill -f "act_runner daemon"
echo "✅ Any running runners have been stopped"
fi