-
Notifications
You must be signed in to change notification settings - Fork 49
210 lines (170 loc) · 6.69 KB
/
example-checks.yml
File metadata and controls
210 lines (170 loc) · 6.69 KB
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
name: Example Checks
on:
pull_request:
branches:
- develop
workflow_dispatch:
jobs:
example-checks:
runs-on: ubuntu-latest
steps:
- name: Get Repo
uses: actions/checkout@v4
- name: Install Foundry in a Different Directory
run: |
export FOUNDRY_DIR="$HOME/foundry_temp"
mkdir -p $FOUNDRY_DIR
export PATH="$FOUNDRY_DIR/bin:$PATH"
echo "Installing Foundry in: $FOUNDRY_DIR"
curl -L https://foundry.paradigm.xyz | bash
echo "Checking Foundry installation..."
ls -lah $FOUNDRY_DIR || echo "ERROR: Foundry installation failed!"
echo "Running foundryup..."
$FOUNDRY_DIR/bin/foundryup || echo "ERROR: Foundryup failed!"
echo "Persisting Foundry PATH for future steps..."
echo "export PATH=$FOUNDRY_DIR/bin:\$PATH" >> $GITHUB_ENV
echo "Verifying Foundry installation..."
$FOUNDRY_DIR/bin/forge --version || echo "ERROR: Forge not found!"
- name: Verify Foundry Installation
run: |
export PATH="$HOME/foundry_temp/bin:$PATH"
forge --version
- name: Setup Docker
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
- name: Start Containers
run: docker-compose up -d
- name: Wait for World Deployer to Finish
run: |
echo "Waiting for world-deployer to complete..."
docker compose logs -f world-deployer &
DEPLOYER_PID=$!
docker wait world-deployer
echo "world-deployer has finished"
- name: Install Node.JS
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install pnpm
run: npm install -g pnpm
- name: Navigate to the smart gate contracts directory
run: |
cd smart-gate/packages/contracts
- name: Set RPC
run: |
cp ./smart-gate/packages/contracts/.envsample ./smart-gate/packages/contracts/.env
sed -i "s|^RPC_URL=.*|RPC_URL=\"http://127.0.0.1:8546\" #RPC URL|" "./smart-gate/packages/contracts/.env"
- name: Install packages
run: |
export PATH="$HOME/foundry_temp/bin:$PATH"
pnpm install --no-frozen-lockfile
working-directory: smart-gate
- name: Deploy Smart Gate Example locally
run: |
export PATH="$HOME/foundry_temp/bin:$PATH"
pnpm deploy:local
working-directory: smart-gate/packages/contracts
- name: Run Smart Gate Tests
run: |
export PATH="$HOME/foundry_temp/bin:$PATH"
pnpm test
working-directory: smart-gate/packages/contracts
- name: Mock Data
run: |
export PATH="$HOME/foundry_temp/bin:$PATH"
pnpm mock-data
working-directory: smart-gate/packages/contracts
- name: Configure
run: |
export PATH="$HOME/foundry_temp/bin:$PATH"
pnpm configure
working-directory: smart-gate/packages/contracts
- name: Link Gates
run: |
export PATH="$HOME/foundry_temp/bin:$PATH"
pnpm link-gates
working-directory: smart-gate/packages/contracts
- name: Can Jump
run: |
export PATH="$HOME/foundry_temp/bin:$PATH"
pnpm can-jump
working-directory: smart-gate/packages/contracts
- name: Set RPC
run: |
cp ./smart-storage-unit/packages/contracts/.envsample ./smart-storage-unit/packages/contracts/.env
sed -i "s|^RPC_URL=.*|RPC_URL=\"http://127.0.0.1:8546\" #RPC URL|" "./smart-storage-unit/packages/contracts/.env"
- name: Install packages
run: |
export PATH="$HOME/foundry_temp/bin:$PATH"
pnpm install --no-frozen-lockfile
working-directory: smart-storage-unit
- name: Deploy Smart Storage Unit Example locally
run: |
export PATH="$HOME/foundry_temp/bin:$PATH"
pnpm deploy:local
working-directory: smart-storage-unit/packages/contracts
- name: Mock Data
run: |
export PATH="$HOME/foundry_temp/bin:$PATH"
pnpm mock-data
working-directory: smart-storage-unit/packages/contracts
- name: Configure
run: |
export PATH="$HOME/foundry_temp/bin:$PATH"
pnpm configure
working-directory: smart-storage-unit/packages/contracts
- name: Execute
run: |
export PATH="$HOME/foundry_temp/bin:$PATH"
pnpm configure
working-directory: smart-storage-unit/packages/contracts
# Reset Docker to avoid function name collisions between smart-gate and smart-turret
- name: Reset Docker World before Smart Turret
run: |
docker-compose down
docker-compose up -d
- name: Wait for World Deployer to Finish (Smart Turret)
run: |
echo "Waiting for world-deployer to complete..."
docker compose logs -f world-deployer &
DEPLOYER_PID=$!
docker wait world-deployer
echo "world-deployer has finished"
- name: Set RPC
run: |
cp ./smart-turret/packages/contracts/.envsample ./smart-turret/packages/contracts/.env
sed -i "s|^RPC_URL=.*|RPC_URL=\"http://127.0.0.1:8546\" #RPC URL|" "./smart-turret/packages/contracts/.env"
- name: Install packages
run: |
export PATH="$HOME/foundry_temp/bin:$PATH"
pnpm install --no-frozen-lockfile
working-directory: smart-turret
- name: Deploy Smart Turret Example locally
run: |
export PATH="$HOME/foundry_temp/bin:$PATH"
pnpm deploy:local
working-directory: smart-turret/packages/contracts
- name: Run Smart Turret Tests
run: |
export PATH="$HOME/foundry_temp/bin:$PATH"
pnpm test
working-directory: smart-turret/packages/contracts
- name: Mock Data
run: |
export PATH="$HOME/foundry_temp/bin:$PATH"
pnpm mock-data
working-directory: smart-turret/packages/contracts
- name: Configure
run: |
export PATH="$HOME/foundry_temp/bin:$PATH"
pnpm configure
working-directory: smart-turret/packages/contracts
- name: Execute
run: |
export PATH="$HOME/foundry_temp/bin:$PATH"
pnpm configure
working-directory: smart-turret/packages/contracts
- name: Stop Docker Containers
if: always()
run: docker-compose down