-
Notifications
You must be signed in to change notification settings - Fork 1
135 lines (110 loc) · 4.18 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
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.PROVIDER_URI_11155111 }}
NEXT_PUBLIC_PROVIDER_URI_8453: ${{ secrets.PROVIDER_URI_8453 }}
NEXT_PUBLIC_PROVIDER_URI_84532: ${{ secrets.PROVIDER_URI_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.NEXT_PUBLIC_RPC_URL_11155111 }}" > .env.local
echo "NEXT_PUBLIC_PROVIDER_URI_11155111=${{ env.NEXT_PUBLIC_PROVIDER_URI_11155111 }}" >> .env.local
echo "NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=${{ env.NEXT_PUBLIC_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: Next.js"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Enable Corepack
uses: actions/checkout@v4
run: corepack enable
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'yarn'
- 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-yarn -s yarn -m npm -c 84532
- name: Forge test
working-directory: ./axiom-init/app-yarn
run: forge test -vvv
- name: Compile circuit
working-directory: ./axiom-init/app-yarn
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-yarn
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-yarn/app
run: yarn start