forked from cosmos/cosmos-sdk
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathWererabbit.yml
121 lines (105 loc) · 3.33 KB
/
Wererabbit.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: RabbitProtocol-CI/CD
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
rabbit-build:
name: 🛠️ Build the Rabbit Protocol
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-24.04, windows-2025, macos-2025]
steps:
- name: 🐇 Checkout Code
uses: actions/checkout@v3
- name: 🐇 Setup Go Environment
uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: 🐇 Install Dependencies
run: |
go mod tidy
go mod vendor
- name: 🐇 Install Docker and Clang
run: |
sudo apt-get update
sudo apt-get install -y docker.io clang
- name: 🐇 Build Docker and Clang ISOs
run: |
mkdir -p iso_mount
echo "Building Docker ISO..."
dd if=/dev/zero of=docker_iso.img bs=1M count=1024
mkfs.ext4 docker_iso.img
echo "Building Clang ISO..."
dd if=/dev/zero of=clang_iso.img bs=1M count=1024
mkfs.ext4 clang_iso.img
- name: 🐇 Mount Docker ISO
run: |
sudo mount -o loop docker_iso.img iso_mount
docker build -t docker_iso_tool ./iso_mount
- name: 🐇 Build with Clang
run: |
sudo mount -o loop clang_iso.img iso_mount
clang --version
clang ./cmd/main.go -o rabbit_protocol_clang
- name: 🐇 Save Build Artifacts
uses: actions/upload-artifact@v3
with:
name: rabbit_protocol_${{ matrix.os }}
path: |
rabbit_protocol
rabbit_protocol_clang
docker_iso.img
clang_iso.img
rabbit-run:
name: 🚀 Run the Rabbit Protocol
runs-on: ${{ matrix.os }}
needs: rabbit-build
steps:
- name: 🐇 Checkout Code
uses: actions/checkout@v3
- name: 🐇 Run Docker and Clang Tests
run: |
docker run --rm -v $(pwd):/usr/src/app -w /usr/src/app docker_iso_tool ./rabbit_protocol
./rabbit_protocol_clang
bugzap-pesterbot:
name: 🐇 BugZap PesterBot
runs-on: ubuntu-latest
needs: rabbit-run
steps:
- name: 🐇 Scan for Rogue Code
run: |
echo "Scanning for pesterbot code..."
grep -r "pesterbot" ./cmd || echo "No pesterbot found!"
- name: 🐇 Fix and Remove Bugs
run: |
# Example remediation
sed -i '/pesterbot/d' ./cmd/main.go
package-toolbelt:
name: 📦 Package Toolbelt/Kit
runs-on: ubuntu-latest
needs: bugzap-pesterbot
steps:
- name: 🐇 Download Build Artifacts
uses: actions/download-artifact@v3
with:
name: rabbit_protocol_${{ matrix.os }}
path: ./builds
- name: 🐇 Create Container Image
run: |
mkdir -p container
mv ./builds/* ./container/
docker build -t rabbit_toolbelt:latest ./container
- name: 🐇 Push Container to Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- run: |
docker tag rabbit_toolbelt:latest ghcr.io/${{ github.repository }}/rabbit_toolbelt:latest
docker push ghcr.io/${{ github.repository }}/rabbit_toolbelt:latest