diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 1d3ff2e..5ac471f 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -2,10 +2,12 @@ name: CI Pipeline run-name: "${{ gitea.actor }} triggered CI pipeline" on: - workflow_dispatch: {} - pull_request: - branches: [main] - types: [opened, reopened, synchronize] + workflow_dispatch: {} # Manual trigger only - run tests locally before merging + # Auto-runs disabled for solo development + # Re-enable when ready for collaborators: + # pull_request: + # branches: [main] + # types: [opened, reopened, synchronize] env: NODE_VERSION: "20" diff --git a/.runner.backup b/.runner.backup deleted file mode 100644 index b8dc1a4..0000000 --- a/.runner.backup +++ /dev/null @@ -1,12 +0,0 @@ -{ - "WARNING": "This file is automatically generated by act-runner. Do not edit it manually unless you know what you are doing. Removing this file will cause act runner to re-register as a new runner.", - "id": 18, - "uuid": "a35806c0-29be-4c15-b5d9-cc265ac762ba", - "name": "community-rule-runner-mac", - "token": "b40fd7ddc8b53bc652640beb0a6837aba10ef967", - "address": "https://git.medlab.host", - "labels": [ - "self-hosted:host", - "macos-latest:host" - ] -} diff --git a/config/gitea-runner.plist b/config/gitea-runner.plist deleted file mode 100644 index 533337c..0000000 --- a/config/gitea-runner.plist +++ /dev/null @@ -1,25 +0,0 @@ - - - - - Label - com.gitea.act-runner - ProgramArguments - - /Users/Vinod/Documents/GitHub/community-rule/act_runner - daemon - --config - /Users/Vinod/Documents/GitHub/community-rule/config/gitea-runner.yaml - - WorkingDirectory - /Users/Vinod/Documents/GitHub/community-rule - RunAtLoad - - KeepAlive - - StandardOutPath - /Users/Vinod/Documents/GitHub/community-rule/runner.log - StandardErrorPath - /Users/Vinod/Documents/GitHub/community-rule/runner-error.log - - diff --git a/config/gitea-runner.yaml b/config/gitea-runner.yaml deleted file mode 100644 index 3036440..0000000 --- a/config/gitea-runner.yaml +++ /dev/null @@ -1,33 +0,0 @@ -log: - level: debug - -runner: - file: .runner - capacity: 2 - timeout: 3h - insecure: false - fetch_timeout: 5s - fetch_interval: 2s - labels: - - "self-hosted" - - "macos-latest" - -cache: - enabled: true - dir: "" - host: "" - port: 0 - external_server: "" - -# container: -# network: "" -# privileged: false -# options: -# workdir_parent: -# valid_volumes: [] -# docker_host: "" -# force_pull: false -# mode: "host" - -host: - workdir_parent: "" diff --git a/config/runner-config.yaml b/config/runner-config.yaml deleted file mode 100644 index 90d11af..0000000 --- a/config/runner-config.yaml +++ /dev/null @@ -1,10 +0,0 @@ -log: - level: info - -runner: - capacity: 2 - -runners: - - name: community-rule-runner - labels: - - "ubuntu-latest:docker://mcr.microsoft.com/playwright:v1.54.2-jammy" diff --git a/runner.log b/runner.log deleted file mode 100644 index b900d70..0000000 --- a/runner.log +++ /dev/null @@ -1,4 +0,0 @@ -time="2026-01-29T20:16:26-07:00" level=info msg="log level changed to debug" func="[initLogging]" file="[daemon.go:158]" -time="2026-01-29T20:16:26-07:00" level=info msg="Starting runner daemon" func="[func6]" file="[daemon.go:38]" -time="2026-01-29T20:16:26-07:00" level=debug msg="gc: 2026-01-29 20:16:26.704803 -0700 MST m=+0.007200001" func="[gcCache]" file="[handler.go:439]" module=artifactcache -time="2026-01-29T20:16:26-07:00" level=info msg="runner: community-rule-runner-mac, with version: v0.2.6, with labels: [self-hosted macos-latest], declare successfully" func="[func6]" file="[daemon.go:109]" diff --git a/scripts/register-runner.sh b/scripts/register-runner.sh deleted file mode 100755 index 7db6615..0000000 --- a/scripts/register-runner.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -# Script to register Gitea runner -# Usage: ./scripts/register-runner.sh - -if [ -z "$1" ]; then - echo "โŒ Error: Registration token required" - echo "" - echo "To get a registration token:" - echo "1. Go to: https://git.medlab.host/CommunityRule/community-rule/settings/actions/runners" - echo "2. Click 'New Runner' or find the registration token" - echo "3. Run: ./scripts/register-runner.sh YOUR_TOKEN" - exit 1 -fi - -TOKEN=$1 -INSTANCE="https://git.medlab.host" -NAME="community-rule-runner-mac" -LABELS="self-hosted,macos-latest" - -echo "๐Ÿš€ Registering runner..." -echo "Instance: $INSTANCE" -echo "Name: $NAME" -echo "Labels: $LABELS" -echo "" - -./act_runner register \ - --instance "$INSTANCE" \ - --token "$TOKEN" \ - --name "$NAME" \ - --labels "$LABELS" \ - --no-interactive - -if [ $? -eq 0 ]; then - echo "" - echo "โœ… Runner registered successfully!" - echo "You can now start it with: ./scripts/start-runner.sh" -else - echo "" - echo "โŒ Registration failed. Please check the token and try again." - exit 1 -fi diff --git a/scripts/start-runner.sh b/scripts/start-runner.sh deleted file mode 100755 index 8773ce0..0000000 --- a/scripts/start-runner.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -echo "๐Ÿš€ Starting Gitea Actions Runner..." - -# Ensure Node.js is available in PATH -export PATH="/usr/local/bin:/opt/homebrew/bin:/usr/bin:/bin:$PATH" - -# Verify Node.js is accessible -if ! command -v node >/dev/null 2>&1; then - echo "โŒ Node.js not found in PATH!" - echo "Current PATH: $PATH" - exit 1 -fi - -echo "โœ… Node.js found: $(which node) - $(node -v)" - -# 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: ./scripts/stop-runner.sh" - exit 1 -fi - -# Start the runner in the background with proper PATH and log redirection -PATH="/usr/local/bin:/opt/homebrew/bin:/usr/bin:/bin:$PATH" ./act_runner daemon --config config/gitea-runner.yaml > runner.log 2>&1 & -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: ./scripts/stop-runner.sh" -echo "To check status, run: ./scripts/status-runner.sh" diff --git a/scripts/status-runner.sh b/scripts/status-runner.sh deleted file mode 100755 index c3749fe..0000000 --- a/scripts/status-runner.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/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: ./scripts/stop-runner.sh" -else - echo "โŒ Runner is NOT RUNNING" - echo "" - echo "To start the runner: ./scripts/start-runner.sh" -fi - -echo "" -echo "๐Ÿ”— Gitea Actions URL:" -echo "https://git.medlab.host/CommunityRule/community-rule/actions" diff --git a/scripts/stop-runner.sh b/scripts/stop-runner.sh deleted file mode 100755 index c13468d..0000000 --- a/scripts/stop-runner.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/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 diff --git a/scripts/test-local.sh b/scripts/test-local.sh new file mode 100755 index 0000000..702a244 --- /dev/null +++ b/scripts/test-local.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# Local testing script - run before committing/merging +# Usage: ./scripts/test-local.sh + +echo "๐Ÿงช Running local tests before commit..." +echo "" + +echo "๐Ÿ” Linting..." +npm run lint || exit 1 + +echo "" +echo "๐Ÿ’… Prettier check..." +npm exec prettier -- --check "**/*.{js,jsx,ts,tsx,json,css,md}" || exit 1 + +echo "" +echo "๐Ÿ“ฆ Component tests with coverage..." +npm test || exit 1 + +echo "" +echo "๐ŸŽญ E2E tests..." +npm run test:e2e || exit 1 + +echo "" +echo "๐Ÿ–ผ๏ธ Visual regression tests..." +npm run visual:test || exit 1 + +echo "" +echo "โšก Performance tests (Lighthouse CI)..." +npm run performance:budget || exit 1 + +echo "" +echo "โœ… All tests passed! Safe to commit/merge." diff --git a/scripts/verify-runner.sh b/scripts/verify-runner.sh deleted file mode 100755 index 887ddac..0000000 --- a/scripts/verify-runner.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -echo "๐Ÿ” Verifying Gitea Runner Status" -echo "=================================" -echo "" - -# Check if runner is registered -if [ ! -f .runner ]; then - echo "โŒ Runner not registered - .runner file not found" - echo " Run: ./scripts/register-runner.sh " - exit 1 -fi - -echo "โœ… Runner registration file exists" -RUNNER_ID=$(cat .runner | grep -o '"id": [0-9]*' | cut -d' ' -f2) -echo " Runner ID: $RUNNER_ID" -echo "" - -# Check if runner is running -if pgrep -f "act_runner daemon" > /dev/null; then - RUNNER_PID=$(pgrep -f "act_runner daemon") - echo "โœ… Runner process is running (PID: $RUNNER_PID)" -else - echo "โš ๏ธ Runner process is NOT running" - echo " Start it with: ./scripts/start-runner.sh" - exit 1 -fi - -echo "" -echo "๐Ÿ“ Recent logs (checking for polling activity):" -if [ -f runner.log ]; then - echo "---" - tail -20 runner.log | grep -E "(polling|fetch|task|job|online|error|Error)" || tail -10 runner.log - echo "---" - echo "" - echo "Look for messages like:" - echo " - 'fetching task' or 'polling' (good - runner is active)" - echo " - 'error' or 'Error' (bad - check the full log)" -else - echo "โš ๏ธ No log file found" -fi - -echo "" -echo "๐Ÿ”— Check runner status in Gitea:" -echo " https://git.medlab.host/CommunityRule/community-rule/settings/actions/runners" -echo "" -echo "The runner should show as 'Idle' (online) if it's working correctly."