-
-
Notifications
You must be signed in to change notification settings - Fork 3
136 lines (116 loc) · 4.71 KB
/
protocol-testing.yml
File metadata and controls
136 lines (116 loc) · 4.71 KB
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
name: Protocol Testing Workflow
on:
push:
branches: [main]
pull_request:
branches: [main]
# Allow manual triggering
workflow_dispatch:
inputs:
test_type:
description: 'Type of test to run'
required: true
default: 'all'
type: choice
options:
- all
- lending
- amm
- staking
- nft
- l2
permissions:
contents: read
issues: write
pull-requests: write
jobs:
protocol-tests:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Set up test environment
run: |
# Create necessary directories
mkdir -p test-results/lending
mkdir -p test-results/amm
mkdir -p test-results/staking
mkdir -p test-results/nft
mkdir -p test-results/l2
- name: Configure RPC endpoint
run: |
# Default public endpoint if secret is not available
DEFAULT_RPC="https://eth-mainnet.public.blastapi.io"
echo "Using RPC endpoint for tests"
echo "RPC_ENDPOINT=$DEFAULT_RPC" >> $GITHUB_ENV
- name: Run Lending Protocol Tests
if: ${{ github.event.inputs.test_type == 'lending' || github.event.inputs.test_type == 'all' || github.event.inputs.test_type == '' }}
run: |
echo "Running lending protocol tests..."
node src/core/defi-testing/cli.js lending-suite Aave --rpc "$RPC_ENDPOINT"
continue-on-error: true
- name: Run AMM Protocol Tests
if: ${{ github.event.inputs.test_type == 'amm' || github.event.inputs.test_type == 'all' || github.event.inputs.test_type == '' }}
run: |
echo "Running AMM protocol tests..."
node src/core/defi-testing/cli.js amm-suite Uniswap --rpc "$RPC_ENDPOINT"
continue-on-error: true
- name: Run Staking Protocol Tests
if: ${{ github.event.inputs.test_type == 'staking' || github.event.inputs.test_type == 'all' || github.event.inputs.test_type == '' }}
run: |
echo "Running staking protocol tests..."
node src/core/defi-testing/cli.js staking-suite Lido --rpc "$RPC_ENDPOINT"
continue-on-error: true
- name: Run NFT Marketplace Tests
if: ${{ github.event.inputs.test_type == 'nft' || github.event.inputs.test_type == 'all' || github.event.inputs.test_type == '' }}
run: |
echo "Running NFT marketplace tests..."
node src/core/defi-testing/cli.js nft-suite seaport --rpc "$RPC_ENDPOINT" --collection 0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d --token-id 1
continue-on-error: true
- name: Run L2 Network Tests
if: ${{ github.event.inputs.test_type == 'l2' || github.event.inputs.test_type == 'all' || github.event.inputs.test_type == '' }}
run: |
echo "Running L2 network tests..."
node src/core/defi-testing/cli.js l2-suite all --rpc "$RPC_ENDPOINT"
continue-on-error: true
- name: Generate Comprehensive Report
run: |
echo "Generating comprehensive report..."
node src/core/defi-testing/cli.js generate-report --output test-results
continue-on-error: true
- name: Upload Test Results
uses: actions/upload-artifact@v4
if: always()
with:
name: protocol-test-results
path: test-results/
- name: Create Summary Report
if: always()
run: |
echo "## Protocol Testing Results" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if ls test-results/comprehensive_report_*.json >/dev/null 2>&1; then
echo "✅ Comprehensive report was generated successfully." >> $GITHUB_STEP_SUMMARY
else
echo "⚠️ Comprehensive report generation may have failed." >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Tested Protocols" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- Lending: Aave" >> $GITHUB_STEP_SUMMARY
echo "- AMM: Uniswap" >> $GITHUB_STEP_SUMMARY
echo "- Staking: Lido" >> $GITHUB_STEP_SUMMARY
echo "- NFT Marketplace: OpenSea (Seaport)" >> $GITHUB_STEP_SUMMARY
echo "- L2 Networks: zkSync Era, Linea, Base, Polygon zkEVM" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "See artifacts for detailed reports." >> $GITHUB_STEP_SUMMARY