-
Notifications
You must be signed in to change notification settings - Fork 1
195 lines (158 loc) · 5.85 KB
/
test.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
name: "Test app initialization"
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
- staging
env:
RPC_URL_11155111: ${{ secrets.RPC_URL_11155111 }}
RPC_URL_8453: ${{ secrets.RPC_URL_8453 }}
RPC_URL_84532: ${{ secrets.RPC_URL_84532 }}
PROVIDER_URI_11155111: ${{ secrets.RPC_URL_11155111 }}
PROVIDER_URI_8453: ${{ secrets.RPC_URL_8453 }}
PROVIDER_URI_84532: ${{ secrets.RPC_URL_84532 }}
PRIVATE_KEY_11155111: ${{ secrets.PRIVATE_KEY_11155111 }}
PRIVATE_KEY_8453: ${{ secrets.PRIVATE_KEY_8453 }}
PRIVATE_KEY_84532: ${{ secrets.PRIVATE_KEY_84532 }}
NEXT_PUBLIC_RPC_URL_11155111: ${{ secrets.RPC_URL_11155111 }}
NEXT_PUBLIC_RPC_URL_8453: ${{ secrets.RPC_URL_8453 }}
NEXT_PUBLIC_RPC_URL_84532: ${{ secrets.RPC_URL_84532 }}
NEXT_PUBLIC_PROVIDER_URI_11155111: ${{ secrets.RPC_URL_11155111 }}
NEXT_PUBLIC_PROVIDER_URI_8453: ${{ secrets.RPC_URL_8453 }}
NEXT_PUBLIC_PROVIDER_URI_84532: ${{ secrets.RPC_URL_84532 }}
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID: ${{ secrets.WALLETCONNECT_PROJECT_ID }}
jobs:
test-nextjs:
name: "axiom-init: Next.js"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Check forge version
run: forge --version
- name: Install npm packages
working-directory: ./axiom-init
run: npm install
- name: Build axiom-init
working-directory: ./axiom-init
run: npm run build
- name: Initialize app
working-directory: ./axiom-init
run: node dist/index.js init -p app-nextjs -s nextjs -m npm -c 11155111
- name: Forge test
working-directory: ./axiom-init/app-nextjs
run: forge test -vvv
- name: Compile circuit
working-directory: ./axiom-init/app-nextjs
run: npx axiom circuit compile app/axiom/average.circuit.ts -p ${{ env.RPC_URL_11155111 }} --force
- name: Write .env.local file
working-directory: ./axiom-init/app-nextjs/app
run: |
echo "NEXT_PUBLIC_RPC_URL_11155111=${{ env.RPC_URL_11155111 }}" > .env.local
echo "NEXT_PUBLIC_PROVIDER_URI_11155111=${{ env.RPC_URL_11155111 }}" >> .env.local
echo "NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=${{ env.WALLETCONNECT_PROJECT_ID }}" >> .env.local
- name: Build Next.js app
working-directory: ./axiom-init/app-nextjs/app
run: npm run build
test-script:
name: "axiom-init: Script"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Enable Corepack
run: corepack enable
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'yarn'
registry-url: "https://registry.npmjs.org"
cache-dependency-path: axiom-init/yarn.lock
- name: Install yarn packages
working-directory: ./axiom-init
run: yarn install --no-lockfile
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Check forge version
run: forge --version
- name: Build axiom-init
working-directory: ./axiom-init
run: yarn build
- name: Initialize app
working-directory: ./axiom-init
run: node dist/index.js init -p app-script -s script -m yarn -c 84532
- name: Forge test
working-directory: ./axiom-init/app-script
run: forge test -vvv
- name: Compile circuit
working-directory: ./axiom-init/app-script
run: npx axiom circuit compile app/axiom/average.circuit.ts -p ${{ env.RPC_URL_84532 }} --force
- name: Write .env file
working-directory: ./axiom-init/app-script
run: |
echo "RPC_URL_84532=${{ env.RPC_URL_84532 }}" > .env
echo "PROVIDER_URI_84532=${{ env.PROVIDER_URI_84532 }}" >> .env
- name: Send query
working-directory: ./axiom-init/app-script/app
run: yarn start
test-forge:
name: "axiom-init: Forge"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8
- name: "Install Node.js"
uses: "actions/setup-node@v4"
with:
node-version: "20.x"
cache: "pnpm"
registry-url: "https://registry.npmjs.org"
cache-dependency-path: axiom-init/pnpm-lock.yaml
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Check forge version
run: forge --version
- name: Install pnpm packages
working-directory: ./axiom-init
run: pnpm install
- name: Build axiom-init
working-directory: ./axiom-init
run: pnpm run build
- name: Initialize app
working-directory: ./axiom-init
run: node dist/index.js init -p app-forge -s forge -m pnpm -c 8453
- name: Forge test
working-directory: ./axiom-init/app-forge
run: forge test -vvv
- name: Compile circuit
working-directory: ./axiom-init/app-forge
run: npx axiom circuit compile app/axiom/average.circuit.ts -p ${{ env.RPC_URL_8453 }} --force
- name: Write .env file
working-directory: ./axiom-init/app-forge
run: |
echo "RPC_URL_8453=${{ env.RPC_URL_8453 }}" > .env
echo "PROVIDER_URI_8453=${{ env.PROVIDER_URI_8453 }}" >> .env
- name: Send query
working-directory: ./axiom-init/app-forge/app
run: yarn start