forked from neonevm/neon-tests
-
Notifications
You must be signed in to change notification settings - Fork 3
168 lines (161 loc) · 5.93 KB
/
dapps.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
name: dApps tests
run-name: dApps tests (${{ inputs.dapps || 'all dapps'}}, ${{ inputs.network || 'terraform' }})
on:
schedule:
- cron: "0 1 * * 6"
workflow_dispatch:
inputs:
network:
type: choice
default: terraform
required: true
description: "Stand name"
options:
- night-stand
- devnet
- terraform
- custom
dapps:
type: string
required: false
description: "List of dapps separated by commas (if empty, all will be run)"
proxy_url:
type: string
required: false
description: "proxy_url (fill only for custom stand)"
solana_url:
type: string
required: false
description: "solana_url (fill only for custom stand)"
faucet_url:
type: string
required: false
description: "faucet_url (fill only for custom stand)"
network_id:
type: string
required: false
description: "network_id (fill only for custom stand)"
pr_url_for_report:
type: string
required: false
description: "Url to send the report as comment for PR"
env:
NETWORK: ${{ inputs.network || 'terraform' }}
BUILD_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
DUMP_ENVS: True
ALL_DAPPS: "aave-v2,aave-v3,curve,uniswap-v2,uniswap-v3,saddle,yearn,robonomics,compound,curve-factory,pancake"
jobs:
prepare:
runs-on: ["self-hosted", "k8s-prod"]
steps:
- uses: actions/checkout@v4
- uses: hashicorp/setup-terraform@v3
- uses: actions/setup-node@v4
with:
node-version: 16
- name: Define dapps to run
id: dapps
run: |
if [[ "${{ inputs.dapps }}" != "" ]]; then
list=${{ inputs.dapps }}
else
list=${{env.ALL_DAPPS}}
fi;
echo "list=${list}"
echo "list=${list}" >> $GITHUB_OUTPUT
- name: "Prepare terraform stand"
if: ${{ env.NETWORK == 'terraform' }}
id: prepare_terraform
timeout-minutes: 15
env:
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
AWS_DEFAULT_REGION: ${{secrets.AWS_DEFAULT_REGION}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
HCLOUD_TOKEN: ${{secrets.HCLOUD_TOKEN}}
TFSTATE_BUCKET: ${{vars.TFSTATE_BUCKET}}
TFSTATE_KEY: ${{vars.TFSTATE_KEY_PREFIX}}-${{ github.run_number }}
TFSTATE_REGION: ${{vars.TFSTATE_REGION}}
uses: ./.github/actions/create-tf-stand
with:
ci_stands_key_hcloud: ${{ secrets.CI_STANDS_KEY_HCLOUD }}
- name: "Define outputs"
id: vars
uses: ./.github/actions/define-stand-env
with:
network: ${{ env.NETWORK }}
devnet_solana_url: ${{ secrets.SOLANA_URL }}
devnet_faucet_url: ${{ secrets.DEVNET_FAUCET_URL }}
proxy_ip: ${{ steps.prepare_terraform.outputs.proxy_ip }}
solana_ip: ${{ steps.prepare_terraform.outputs.solana_ip }}
proxy_url: ${{ inputs.proxy_url }}
solana_url: ${{ inputs.solana_url }}
faucet_url: ${{ inputs.faucet_url }}
network_id: ${{ inputs.network_id }}
outputs:
network: ${{ env.NETWORK }}
solana_url: ${{ steps.vars.outputs.solana_url }}
proxy_url: ${{ steps.vars.outputs.proxy_url }}
faucet_url: ${{ steps.vars.outputs.faucet_url }}
network_id: ${{ steps.vars.outputs.network_id }}
proxy_ip: ${{ steps.prepare_terraform.outputs.proxy_ip }}
solana_ip: ${{ steps.prepare_terraform.outputs.solana_ip }}
dapps: ${{ steps.dapps.outputs.list }}
dapps-tests:
needs:
- prepare
uses: ./.github/workflows/dapps_reusable.yml
secrets: inherit
with:
network: ${{ needs.prepare.outputs.network }}
dapps: ${{ needs.prepare.outputs.dapps }}
proxy_url: ${{ needs.prepare.outputs.proxy_url }}
solana_url: ${{ needs.prepare.outputs.solana_url }}
faucet_url: ${{ needs.prepare.outputs.faucet_url }}
network_id: ${{ needs.prepare.outputs.network_id }}
pr_url_for_report: ${{ inputs.pr_url_for_report }}
proxy_ip: ${{ needs.prepare.outputs.proxy_ip }}
solana_ip: ${{ needs.prepare.outputs.solana_ip }}
external_call: false
repo: "tests"
notify:
runs-on: ["self-hosted", "k8s-prod"]
needs: [ prepare, dapps-tests ]
if: failure() && github.ref_name == 'develop'
steps:
- uses: actions/checkout@v4
- name: Install python requirements
id: requirements
uses: ./.github/actions/python-requirements
- name: Notify on failure
id: notification
run: |
python3 ./clickfile.py send-notification \
--network ${{ env.NETWORK }} \
-u ${{ secrets.SLACK_QA_CHANNEL_URL }} \
-b ${{ env.BUILD_URL }} \
--test-group dapps
destroy:
runs-on: ["self-hosted", "k8s-prod"]
needs: [ prepare, dapps-tests ]
if: always() && needs.prepare.outputs.network == 'terraform'
steps:
- uses: actions/checkout@v4
- uses: hashicorp/setup-terraform@v3
- uses: actions/setup-node@v4
with:
node-version: 16
- name: "Destroy stand"
env:
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
AWS_DEFAULT_REGION: ${{secrets.AWS_DEFAULT_REGION}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
HCLOUD_TOKEN: ${{secrets.HCLOUD_TOKEN}}
TFSTATE_BUCKET: ${{vars.TFSTATE_BUCKET}}
TFSTATE_KEY: ${{vars.TFSTATE_KEY_PREFIX}}-${{ github.run_number }}
TFSTATE_REGION: ${{vars.TFSTATE_REGION}}
PROXY_IP: ${{ needs.prepare.outputs.proxy_ip }}
SOLANA_IP: ${{ needs.prepare.outputs.solana_ip }}
uses: ././.github/actions/destroy-tf-stand
with:
ci_stands_key_hcloud: ${{ secrets.CI_STANDS_KEY_HCLOUD }}
devnet_solana_url: ${{ secrets.SOLANA_URL }}