-
Notifications
You must be signed in to change notification settings - Fork 53
257 lines (214 loc) · 6.92 KB
/
ci.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
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
name: ✨ Build & Release AOS
on:
pull_request:
branches:
- main
push:
branches:
- main
# Perform a release using a workflow dispatch
workflow_dispatch:
inputs:
sqlite:
description: 'Build a aos-sqlite module?'
required: true
type: boolean
llama:
description: 'Build a aos-llama module?'
required: true
type: boolean
defaults:
run:
shell: bash
jobs:
test:
if: github.event_name != 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
node-version: 22
- name: 🤖 Setup ao dev-cli
run: |
curl -fsSL https://install_ao.g8way.io | bash
- name: 📥 Download Process deps
working-directory: process
run: |
yarn
- name: 📥 Download Extensions deps
working-directory: extensions/weavedrive
run: |
yarn
- name: 🏗 Build Process Module
working-directory: process
run: |
/home/runner/.ao/bin/ao build
- name: ⚡ Run Tests
run: |
yarn test-all
env:
CI: true
# test-console:
# if: github.event_name != 'workflow_dispatch'
# runs-on: ubuntu-latest
# timeout-minutes: 5
# steps:
# - name: ⬇️ Checkout repo
# uses: actions/checkout@v4
# - name: ⎔ Setup node
# uses: actions/setup-node@v4
# with:
# node-version: 22
# - name: 📥 Download deps
# run: |
# yarn
# - name: ⚡ Run Tests
# run: |
# # yarn test
# echo "::warning::TODO: Fix aos Console tests. Skipping for now..."
# env:
# CI: true
# test-process:
# if: github.event_name != 'workflow_dispatch'
# runs-on: ubuntu-latest
# timeout-minutes: 5
# steps:
# - name: ⬇️ Checkout repo
# uses: actions/checkout@v4
# - name: ⎔ Setup node
# uses: actions/setup-node@v4
# with:
# node-version: 22
# - name: 🤖 Setup ao dev-cli
# run: |
# curl -fsSL https://install_ao.g8way.io | bash
# - name: 📥 Download deps
# working-directory: process
# run: |
# yarn
# - name: 🏗 Build Module
# working-directory: process
# run: |
# /home/runner/.ao/bin/ao build
# - name: ⚡ Run Tests
# working-directory: process
# run: |
# yarn test
# env:
# CI: true
release:
# Releases are performed via a workflow dispatch
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 10
concurrency:
group: release
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
# TODO: will need when we add automatically bumping based on semver, later
# with:
# fetch-depth: 0
# ref: main
- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: "https://registry.npmjs.org"
- name: 🤖 Setup ao dev-cli
run: |
curl -fsSL https://install_ao.g8way.io | bash
- name: 👀 Env
run: |
echo "Event name: ${{ github.event_name }}"
echo "Git ref: ${{ github.ref }}"
echo "GH actor: ${{ github.actor }}"
echo "SHA: ${{ github.sha }}"
VER=`node --version`; echo "Node ver: $VER"
VER=`npm --version`; echo "npm ver: $VER"
- name: 🤓 Set Git User
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
- name: 📥 Download deps
run: |
yarn
# Build aos
- name: Build aos Module
id: aos_module
run: |
if [ -d "process/libs" ]; then rm -rf process/libs; fi
if [ -e "process/process.wasm" ]; then rm -f process/process.wasm; fi
if [ -e "process/config.yml" ]; then rm -f process/config.yml; fi
(cd process && /home/runner/.ao/bin/ao build)
AOS_MODULE_PATH="$PWD/process/process.wasm"
echo "aos_module_path=${AOS_MODULE_PATH}" >> $GITHUB_OUTPUT
# TODO: instead upload to Arweave as ao Module DataItem
- name: 🗃 Upload aos Module
uses: actions/upload-artifact@v4
with:
name: aos.wasm
path: ${{ steps.aos_module.outputs.aos_module_path }}
retention-days: 10
# Build aos-sqlite
- name: 🗄️ Build aos SQLite Module
id: aos_sqlite_module
if: inputs.sqlite
run: |
if [ -d "process/libs" ]; then rm -rf process/libs; fi
if [ -e "process/process.wasm" ]; then rm -f process/process.wasm; fi
if [ -e "process/config.yml" ]; then rm -f process/config.yml; fi
cp -r modules/sqlite3/. process/
(cd process && /home/runner/.ao/bin/ao build)
AOS_MODULE_PATH="$PWD/process/process.wasm"
echo "aos_module_path=${AOS_MODULE_PATH}" >> $GITHUB_OUTPUT
# TODO: instead upload to Arweave as ao Module DataItem
- name: 🗃 Upload aos SQLite Module
if: inputs.sqlite
uses: actions/upload-artifact@v4
with:
name: aos-sqlite.wasm
path: ${{ steps.aos_sqlite_module.outputs.aos_module_path }}
retention-days: 10
# Build aos-llama
- name: 🦙 Build aos Llama Module
id: aos_llama_module
if: inputs.llama
run: |
if [ -d "process/libs" ]; then rm -rf process/libs; fi
if [ -e "process/process.wasm" ]; then rm -f process/process.wasm; fi
if [ -e "process/config.yml" ]; then rm -f process/config.yml; fi
cp -r modules/llama/. ./process/
(cd process && /home/runner/.ao/bin/ao build)
AOS_MODULE_PATH="$PWD/process/process.wasm"
echo "aos_module_path=${AOS_MODULE_PATH}" >> $GITHUB_OUTPUT
# TODO: instead upload to Arweave as ao Module DataItem
- name: 🗃 Upload aos Llama Module
if: inputs.llama
uses: actions/upload-artifact@v4
with:
name: aos-llama.wasm
path: ${{ steps.aos_llama_module.outputs.aos_module_path }}
retention-days: 10
# Set up Lua
- name: 🔧 Set up Lua
uses: leafo/gh-actions-lua@v10
with:
luaVersion: 5.3
# Install LDoc
- name: 📦 Install LDoc
run: |
luarocks install ldoc
# Build process docs
- name: 📄 Build Process Docs
run: |
yarn build-docs
# TODO: update manifests with new version and txids
# - name: ⬆️ Push
# run: |
# git push
# git push --tags