-
Notifications
You must be signed in to change notification settings - Fork 4
165 lines (138 loc) · 4.85 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
155
156
157
158
159
160
161
162
163
164
165
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'
env:
CARGO_TERM_COLOR: always
GITHUB_ACTIONS: true
APTOS_NETWORK: testnet
ARTIFACTS_LEVEL: none
DEFAULT_FUND_AMOUNT: 40000000
PYTH_HERMES_URL: https://hermes-beta.pyth.network
PYTH_CONTRACT_ACCOUNT: 0x0000000000000000000000000000000000000000000000000000000000000000
PYTH_DEPLOYER_ACCOUNT: 0x0000000000000000000000000000000000000000000000000000000000000000
PYTH_WORMHOLE: 0x0000000000000000000000000000000000000000000000000000000000000000
jobs:
testnet-deployment:
name: Deploy protocol on Testnet
runs-on: ubuntu-latest
timeout-minutes: 60
env:
DEFAULT_FUNDER_PRIVATE_KEY: ${{ secrets.GH_DEFAULT_FUNDER_PRIVATE_KEY }}
APTOS_NETWORK: ${{ github.event.inputs.network }}
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: Checkout aptos-core repository
run: |
git clone https://github.com/0xjunha/aptos-core.git
cd aptos-core
git checkout large_packages_e2e
- name: Cache Cargo registry
uses: actions/cache@v4
id: cargo-cache
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('aptos-core/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache Cargo target directory
uses: actions/cache@v4
id: cargo-target-cache
with:
path: aptos-core/target
key: ${{ runner.os }}-cargo-target-${{ hashFiles('aptos-core/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-target-
- name: Build custom Aptos CLI
run: |
cd aptos-core
sh scripts/cli/build_cli_release.sh
- name: Replace original Aptos CLI
run: |
cd aptos-core
zip_file=$(ls aptos-cli-*.zip)
unzip $zip_file
sudo mv /home/runner/.local/bin/aptos /home/runner/.local/bin/aptos_backup || true
sudo mv aptos /home/runner/.local/bin/aptos
aptos --version # Verify that the new 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 init-data
working-directory: test-suites
- name: Running Core Operations
if: ${{ github.event.inputs.initData == 'true' }}
run: pnpm run core-operations
working-directory: test-suites