/ .forgejo / workflows / ci.yml.disabled
ci.yml.disabled
 1  name: CI
 2  
 3  on:
 4    push:
 5      branches: [main]
 6    pull_request:
 7      branches: [main]
 8  
 9  jobs:
10    lint:
11      runs-on: native
12      steps:
13        - name: Checkout
14          uses: actions/checkout@v4
15  
16        - name: Check Python syntax
17          run: |
18            python3 -m py_compile backend/main.py
19            python3 -m py_compile backend/ci-watcher.py
20  
21        - name: Check for common issues
22          run: |
23            for f in backend/*.py; do
24              python3 -c "import ast; ast.parse(open('$f').read())" || exit 1
25            done
26  
27    coverage:
28      name: Code Coverage
29      runs-on: native
30      needs: lint
31      continue-on-error: true
32      timeout-minutes: 15
33      steps:
34        - name: Checkout
35          uses: actions/checkout@v4
36  
37        - name: Install test dependencies
38          run: pip3 install --user --break-system-packages pytest pytest-cov pytest-asyncio
39  
40        - name: Run Tests with Coverage
41          run: |
42            cd backend
43            python3 -m pytest \
44              --cov=. \
45              --cov-report=xml:coverage.xml \
46              --cov-report=term \
47              -v || true
48  
49        - name: Upload to Codecov
50          if: always()
51          continue-on-error: true
52          env:
53            CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
54          run: |
55            codecov \
56              --token "$CODECOV_TOKEN" \
57              --file backend/coverage.xml \
58              --flags ci-dashboard \
59              --name "${{ github.sha }}" \
60              --nonZero || true
61  
62    deploy:
63      runs-on: native
64      needs: lint
65      if: github.ref == 'refs/heads/main' && github.event_name == 'push'
66      steps:
67        - name: Deploy to source server
68          run: |
69            ssh -p 2584 -o BatchMode=yes -o StrictHostKeyChecking=accept-new devops@source.ac-dc.network << 'DEPLOY'
70              cd /home/devops/ci-dashboard
71              git fetch forgejo main
72              git reset --hard forgejo/main
73              # Restart backend if running as systemd service
74              if systemctl is-active --quiet ci-dashboard; then
75                sudo systemctl restart ci-dashboard
76                echo "Backend service restarted"
77              else
78                echo "No systemd service, backend will pick up changes on next request"
79              fi
80              echo "Deploy complete: $(git rev-parse --short HEAD)"
81            DEPLOY
82  
83    radicle-sync:
84      name: Radicle Sync
85      needs: [lint, deploy]
86      if: github.ref == 'refs/heads/main' && github.event_name == 'push'
87      uses: alpha-delta-network/alpha-delta-context/.forgejo/workflows/radicle-sync.yml@main
88      with:
89        rid: "rad:z233GtFMEuSTU35DQ7Ya8GuCD7TVr"