/ .forgejo / workflows / ci.yml
ci.yml
 1  # Forgejo CI/CD for acdc-core
 2  
 3  concurrency:
 4    group: ci-${{ github.ref }}
 5    cancel-in-progress: true
 6  # Sequential pipeline: format → check → build → test → radicle
 7  # Simplified pipeline for stability (2026-01-09)
 8  
 9  name: Rust Build
10  
11  on:
12    push:
13      branches: [main]
14    pull_request:
15      branches: [main]
16  
17  env:
18    CARGO_HOME: /home/devops/.cargo
19    RUSTUP_HOME: /home/devops/.rustup
20    PATH: /home/devops/.cargo/bin:/usr/local/bin:/usr/bin:/bin
21  
22  jobs:
23    format:
24      name: Format
25      runs-on: native
26      steps:
27        - name: Checkout
28          uses: actions/checkout@v4
29  
30        - name: Check Formatting
31          run: /home/devops/.cargo/bin/cargo +nightly fmt --check
32  
33    check:
34      name: Check
35      runs-on: native
36      needs: format
37      steps:
38        - name: Checkout
39          uses: actions/checkout@v4
40  
41        - name: Cargo Check
42          run: /home/devops/.cargo/bin/cargo check --workspace
43  
44    build:
45      name: Build
46      runs-on: native
47      needs: check
48      steps:
49        - name: Checkout
50          uses: actions/checkout@v4
51  
52        - name: Build
53          run: /home/devops/.cargo/bin/cargo build --release
54  
55    test:
56      name: Test
57      runs-on: native
58      needs: build
59      steps:
60        - name: Checkout
61          uses: actions/checkout@v4
62  
63        - name: Test
64          run: /home/devops/.cargo/bin/cargo test --release
65  
66    radicle-push:
67      name: Radicle Sync
68      runs-on: native
69      needs: test
70      if: github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
71      steps:
72        - name: Checkout from Forgejo
73          uses: actions/checkout@v4
74          with:
75            fetch-depth: 0
76            path: forgejo-src
77  
78        - name: Sync to Radicle
79          run: |
80            export PATH=$HOME/.radicle/bin:$PATH
81            RID="rad:z3RxrMszP6svcm1S5g1wfUubqUThQ"
82  
83            rad clone "$RID" radicle-repo || true
84            cd radicle-repo
85  
86            git remote add forgejo ../forgejo-src || git remote set-url forgejo ../forgejo-src
87            git fetch forgejo main
88  
89            git checkout main
90            git merge --ff-only forgejo/main || git reset --hard forgejo/main
91  
92            git push rad main