-
Notifications
You must be signed in to change notification settings - Fork 4
154 lines (129 loc) · 4.98 KB
/
testnet-deployment.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
name: Testnet Deployment
on:
workflow_dispatch:
inputs:
network:
description: 'Network'
required: true
default: 'testnet'
type: choice
options:
- testnet
- devnet
initData:
description: 'Initialize Data'
required: true
default: 'false'
type: choice
options:
- 'true'
- 'false'
upgradeContracts:
description: 'Upgrade Contracts'
required: true
default: 'false'
type: choice
options:
- 'true'
- 'false'
jobs:
testnet-deployment:
name: Deploy protocol on Testnet
runs-on: Larger-Github-Runners
timeout-minutes: 60
env:
# common settings
CARGO_TERM_COLOR: always
GITHUB_ACTIONS: true
ARTIFACTS_LEVEL: all
DEFAULT_FUND_AMOUNT: 40000000
APTOS_NETWORK: ${{ github.event.inputs.network }}
UPGRADE_CONTRACTS: ${{ github.event.inputs.upgradeContracts }}
# external profiles
CHAINLINK_DATA_FEEDS: ${{ secrets.GH_CHAINLINK_DATA_FEEDS }}
CHAINLINK_PLATFORM: ${{ secrets.GH_CHAINLINK_PLATFORM }}
# aave profiles
AAVE_ACL_PRIVATE_KEY: ${{ secrets.GH_AAVE_ACL_PRIVATE_KEY }}
AAVE_CONFIG_PRIVATE_KEY: ${{ secrets.GH_AAVE_CONFIG_PRIVATE_KEY }}
AAVE_MATH_PRIVATE_KEY: ${{ secrets.GH_AAVE_MATH_PRIVATE_KEY }}
AAVE_RATE_PRIVATE_KEY: ${{ secrets.GH_AAVE_RATE_PRIVATE_KEY }}
AAVE_ORACLE_PRIVATE_KEY: ${{ secrets.GH_AAVE_ORACLE_PRIVATE_KEY }}
AAVE_POOL_PRIVATE_KEY: ${{ secrets.GH_AAVE_POOL_PRIVATE_KEY }}
A_TOKENS_PRIVATE_KEY: ${{ secrets.GH_A_TOKENS_PRIVATE_KEY }}
UNDERLYING_TOKENS_PRIVATE_KEY: ${{ secrets.GH_UNDERLYING_TOKENS_PRIVATE_KEY }}
VARIABLE_TOKENS_PRIVATE_KEY: ${{ secrets.GH_VARIABLE_TOKENS_PRIVATE_KEY }}
AAVE_LARGE_PACKAGES_PRIVATE_KEY: ${{ secrets.GH_AAVE_LARGE_PACKAGES_PRIVATE_KEY }}
AAVE_DATA_PRIVATE_KEY: ${{ secrets.GH_AAVE_DATA_PRIVATE_KEY }}
DEFAULT_FUNDER_PRIVATE_KEY: ${{ secrets.GH_DEFAULT_FUNDER_PRIVATE_KEY }}
# test profiles
TEST_ACCOUNT_0_PRIVATE_KEY: ${{ secrets.GH_TEST_ACCOUNT_0_PRIVATE_KEY }}
TEST_ACCOUNT_1_PRIVATE_KEY: ${{ secrets.GH_TEST_ACCOUNT_1_PRIVATE_KEY }}
TEST_ACCOUNT_2_PRIVATE_KEY: ${{ secrets.GH_TEST_ACCOUNT_2_PRIVATE_KEY }}
TEST_ACCOUNT_3_PRIVATE_KEY: ${{ secrets.GH_TEST_ACCOUNT_3_PRIVATE_KEY }}
TEST_ACCOUNT_4_PRIVATE_KEY: ${{ secrets.GH_TEST_ACCOUNT_4_PRIVATE_KEY }}
TEST_ACCOUNT_5_PRIVATE_KEY: ${{ secrets.GH_TEST_ACCOUNT_5_PRIVATE_KEY }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y libudev-dev lld libdw-dev
- name: Install Aptos CLI
run: |
curl -fsSL "https://aptos.dev/scripts/install_cli.py" | python3
aptos --version # Verify that Aptos CLI is installed
- name: Set Aptos Workspace Config
run: make set-workspace-config
- name: Init Aptos Workspace Config
run: make init-workspace-config
- name: Run Aptos Create Profiles
run: make init-profiles
- name: Run Aptos Create Test Profiles
run: make init-test-profiles
- name: Run Aptos Top-Up Profiles
run: make top-up-profiles
- name: Run Aptos Top-Up Test Profiles
run: make top-up-test-profiles
- name: Print Aptos Config File
run: cat ./.aptos/config.yaml
- name: Run Aptos Compile All Contracts
run: make compile-all
- name: Run Aptos Publish All Contracts
run: make publish-all
- name: Install Node.js
if: ${{ github.event.inputs.initData == 'true' }}
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install pnpm
if: ${{ github.event.inputs.initData == 'true' }}
uses: pnpm/action-setup@v3
with:
version: 8
run_install: false
- name: Get pnpm store directory
if: ${{ github.event.inputs.initData == 'true' }}
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
if: ${{ github.event.inputs.initData == 'true' }}
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install npm dependencies
if: ${{ github.event.inputs.initData == 'true' }}
run: pnpm install
working-directory: test-suites
- name: Initialize Data
if: ${{ github.event.inputs.initData == 'true' }}
run: pnpm run deploy:init-data
working-directory: test-suites
- name: Running Core Operations
if: ${{ github.event.inputs.initData == 'true' }}
run: pnpm run deploy:core-operations
working-directory: test-suites