-
Notifications
You must be signed in to change notification settings - Fork 1
144 lines (127 loc) · 6.55 KB
/
ci-dev-sdk.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
name: ci-dev-sdk
defaults:
run:
working-directory: .
on:
push:
branches: [ "*" ]
paths:
- "packages/sdk/**"
jobs:
deploy:
runs-on: ubuntu-latest
environment: dev
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "yarn"
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Install dependencies
run: yarn install
- uses: isbang/[email protected]
with:
compose-file: docker-compose.yml
compose-command: up
compose-options: --build
env:
NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.SDK_NEXT_PUBLIC_SUPABASE_URL }}
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.SDK_NEXT_PUBLIC_SUPABASE_ANON_KEY }}
SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SDK_SUPABASE_SERVICE_ROLE_KEY }}
SUPABASE_JWT_SECRET: ${{ secrets.SDK_SUPABASE_JWT_SECRET }}
ETHERS_CUSTODIAN_PRIVATE_KEY: ${{ secrets.SDK_ETHERS_CUSTODIAN_PRIVATE_KEY }}
ETHERS_DEPLOYER_PRIVATE_KEY: ${{ secrets.SDK_ETHERS_DEPLOYER_PRIVATE_KEY }}
CRON_SECRET: ${{ secrets.SDK_CRON_SECRET }}
NEXT_PUBLIC_TARGET_NETWORK_WSS: ${{ secrets.SDK_NEXT_PUBLIC_TARGET_NETWORK_WSS }}
ETHERS_PROVIDER_URLS: ${{ secrets.SDK_ETHERS_PROVIDER_URLS }}
SLACK_TOKEN: ${{ secrets.SDK_SLACK_TOKEN }}
WSS_PROVIDER_URLS: ${{ secrets.SDK_WSS_PROVIDER_URLS }}
OPERATOR_ADDRESS: ${{ secrets.SDK_OPERATOR_ADDRESS }}
APP_PORT: 3001
APP_VERSION: 0.0.1000
- uses: supabase/setup-cli@v1
with:
version: latest
- run: cd packages/api/supabase && supabase link --project-ref ${{ secrets.SDK_SUPABASE_PROJECT_ID }} && supabase db push
env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SDK_SUPABASE_ACCESS_TOKEN }}
PROJECT_ID: ${{ secrets.SDK_SUPABASE_PROJECT_ID }}
SUPABASE_DB_PASSWORD: ${{ secrets.SDK_SUPABASE_DB_PASSWORD }}
- name: Deploy contracts
run: cd packages/contracts/ && yarn deploy
env:
EXPORT_TO_SUPABASE: true
NEXT_PUBLIC_TARGET_NETWORK_ID: 31337
COLLATERAL_PERCENTAGE: 200
DEFAULT_ANVIL_KEY: ${{ secrets.SDK_DEFAULT_ANVIL_KEY }}
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
VAULT_OPENS_AT_TIMESTAMP: ${{ secrets.SDK_VAULT_OPENS_AT_TIMESTAMP }}
VAULT_CLOSES_DURATION_TIMESTAMP: ${{ secrets.SDK_VAULT_CLOSES_DURATION_TIMESTAMP }}
NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.SDK_NEXT_PUBLIC_SUPABASE_URL }}
PUBLIC_OPERATOR_ADDRESS: "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
PUBLIC_OWNER_ADDRESS: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SDK_SUPABASE_SERVICE_ROLE_KEY }}
# - name: Create FixedYield and Upside vault
# run: cd scripts/operation/ && yarn op --create-vault && yarn op --create-vault upside upsideVault:self
# env:
# API_BASE_URL: ${{ secrets.SDK_API_BASE_URL }}
# NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.SDK_NEXT_PUBLIC_SUPABASE_URL }}
# NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.SDK_NEXT_PUBLIC_SUPABASE_ANON_KEY }}
# NEXT_PUBLIC_TARGET_NETWORK: ${{ secrets.SDK_NEXT_PUBLIC_TARGET_NETWORK }}
# SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SDK_SUPABASE_SERVICE_ROLE_KEY }}
# ADMIN_PRIVATE_KEY: ${{ secrets.SDK_ADMIN_PRIVATE_KEY }}
# ADMIN_EMAIL: ${{ secrets.SDK_ADMIN_EMAIL }}
# ADMIN_PASSWORD: ${{ secrets.SDK_ADMIN_PASSWORD }}
# PUBLIC_OWNER_ADDRESS: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
# PUBLIC_OPERATOR_ADDRESS: "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
# ADDRESSES_TREASURY: "0x14dC79964da2C08b23698B3D3cc7Ca32193d9955"
# ADDRESSES_ACTIVITY_REWARD: "0x14dC79964da2C08b23698B3D3cc7Ca32193d9955"
- name: Logs
run: docker logs api --tail all
- name: Run SDK tests
run: cd packages/sdk/ && yarn test
env:
ADMIN_PRIVATE_KEY_SDK: ${{ secrets.SDK_DEFAULT_ANVIL_KEY }}
ADMIN_EMAIL_SDK: [email protected]
ADMIN_PASSWORD_SDK: admin123
USER_A_PRIVATE_KEY: ${{ secrets.SDK_USER_A_PRIVATE_KEY }}
USER_A_EMAIL: [email protected]
USER_A_PASSWORD: usera123
USER_B_PRIVATE_KEY: ${{ secrets.SDK_USER_B_PRIVATE_KEY }}
USER_B_EMAIL: [email protected]
USER_B_PASSWORD: userb123
NODE_ENV: development
BASE_URL: http://localhost:3001
CRON_SECRET: ${{ secrets.SDK_CRON_SECRET }}
OPERATOR_PRIVATE_KEY: ${{ secrets.SDK_ETHERS_DEPLOYER_PRIVATE_KEY }}
API_BASE_URL: ${{ secrets.SDK_API_BASE_URL }}
NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.SDK_NEXT_PUBLIC_SUPABASE_URL }}
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.SDK_NEXT_PUBLIC_SUPABASE_ANON_KEY }}
NEXT_PUBLIC_TARGET_NETWORK: ${{ secrets.SDK_NEXT_PUBLIC_TARGET_NETWORK }}
SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SDK_SUPABASE_SERVICE_ROLE_KEY }}
ADMIN_PRIVATE_KEY: ${{ secrets.SDK_ADMIN_PRIVATE_KEY }}
ADMIN_EMAIL: ${{ secrets.SDK_ADMIN_EMAIL }}
ADMIN_PASSWORD: ${{ secrets.SDK_ADMIN_PASSWORD }}
PUBLIC_OWNER_ADDRESS: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
PUBLIC_OPERATOR_ADDRESS: "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
ADDRESSES_TREASURY: "0x14dC79964da2C08b23698B3D3cc7Ca32193d9955"
ADDRESSES_ACTIVITY_REWARD: "0x14dC79964da2C08b23698B3D3cc7Ca32193d9955"
- name: Clean vault data
run: cd scripts/operation/ && yarn op --clean-vault-table
env:
API_BASE_URL: ${{ secrets.SDK_API_BASE_URL }}
NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.SDK_NEXT_PUBLIC_SUPABASE_URL }}
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.SDK_NEXT_PUBLIC_SUPABASE_ANON_KEY }}
NEXT_PUBLIC_TARGET_NETWORK: ${{ secrets.SDK_NEXT_PUBLIC_TARGET_NETWORK }}
SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SDK_SUPABASE_SERVICE_ROLE_KEY }}
ADMIN_PRIVATE_KEY: ${{ secrets.SDK_ADMIN_PRIVATE_KEY }}
ADMIN_EMAIL: ${{ secrets.SDK_ADMIN_EMAIL }}
ADMIN_PASSWORD: ${{ secrets.SDK_ADMIN_PASSWORD }}
PUBLIC_OWNER_ADDRESS: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
PUBLIC_OPERATOR_ADDRESS: "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
ADDRESSES_TREASURY: "0x14dC79964da2C08b23698B3D3cc7Ca32193d9955"
ADDRESSES_ACTIVITY_REWARD: "0x14dC79964da2C08b23698B3D3cc7Ca32193d9955"