forked from storyprotocol/protocol-periphery
-
Notifications
You must be signed in to change notification settings - Fork 45
198 lines (171 loc) · 8.68 KB
/
test-integration.yml
File metadata and controls
198 lines (171 loc) · 8.68 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
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
name: Integration Test
on:
# push:
# branches: [ "integration-test-workflow" ]
workflow_dispatch:
inputs:
devnet_version:
description: 'aeneid; mainnet; internal-devnet'
required: true
default: 'internal-devnet'
type: choice
options:
- aeneid
- mainnet
- internal-devnet
jobs:
print-config:
runs-on: ubuntu-latest
steps:
- name: Print Inputs
run: |
echo "Inputs:"
echo "devnet_version: ${{ inputs.devnet_version || github.event.inputs.devnet_version || 'internal-devnet' }}"
set-devnet-constants:
runs-on: ubuntu-latest
steps:
- name: Devnet Version
id: devnet_version
run: |
declare -A devnet_config=(
["aeneid"]="1315 https://aeneid.storyrpc.io"
["mainnet"]="1514 https://public.storyrpc.io"
["internal-devnet"]="1512 https://rpc.devnet.storyrpc.io"
)
devnet_version="${{ inputs.devnet_version || github.event.inputs.devnet_version || 'internal-devnet' }}"
if [[ -n "${devnet_config[$devnet_version]}" ]]; then
read -r chainid rpcurl <<< "${devnet_config[$devnet_version]}"
echo "CHAINID=$chainid" >> $GITHUB_OUTPUT
echo "RPCURL='$rpcurl'" >> $GITHUB_OUTPUT
else
echo "Unknown devnet version: $devnet_version"
exit 1
fi
outputs:
CHAINID: ${{ steps.devnet_version.outputs.CHAINID }}
RPCURL: ${{ steps.devnet_version.outputs.RPCURL }}
test-integration:
needs: set-devnet-constants
runs-on: ubuntu-latest
env:
RPC_URL: ${{ needs.set-devnet-constants.outputs.RPCURL }}
TEST_SENDER_ADDRESS: "0x7D01c62110fb498e6450A7857DD172dDd41EAbD3"
TEST_SENDER_SECRETKEY: ${{ secrets.TEST_SENDER_SECRETKEY }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Run install
uses: borales/actions-yarn@v4
with:
cmd: install # will run `yarn install` command
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Set Protocol Addresses
run: |
PROTOCOL_ADDRESS='{
"main": {
"AccessController": "0xcCF37d0a503Ee1D4C11208672e622ed3DFB2275a",
"ArbitrationPolicyUMA": "0xfFD98c3877B8789124f02C7E8239A4b0Ef11E936",
"CoreMetadataModule": "0x6E81a25C99C6e8430aeC7353325EB138aFE5DC16",
"CoreMetadataViewModule": "0xB3F88038A983CeA5753E11D144228Ebb5eACdE20",
"DisputeModule": "0x9b7A9c70AFF961C799110954fc06F3093aeb94C5",
"EvenSplitGroupPool": "0xf96f2c30b41Cb6e0290de43C8528ae83d4f33F89",
"GroupNFT": "0x4709798FeA84C84ae2475fF0c25344115eE1529f",
"GroupingModule": "0x69D3a7aa9edb72Bc226E745A7cCdd50D947b69Ac",
"IPAccountImpl": "0xc93d49fEdED1A2fbE3B54223Df65f4edB3845eb0",
"IPAssetRegistry": "0x77319B4031e6eF1250907aa00018B8B1c67a244b",
"IPGraphACL": "0x1640A22a8A086747cD377b73954545e2Dfcc9Cad",
"IpRoyaltyVaultBeacon": "0x6928ba25Aa5c410dd855dFE7e95713d83e402AA6",
"IpRoyaltyVaultImpl": "0x63cC7611316880213f3A4Ba9bD72b0EaA2010298",
"LicenseRegistry": "0x529a750E02d8E2f15649c13D69a465286a780e24",
"LicenseToken": "0xFe3838BFb30B34170F00030B52eA4893d8aAC6bC",
"LicensingModule": "0x04fbd8a2e56dd85CFD5500A4A4DfA955B9f1dE6f",
"MockERC20": "0x1514000000000000000000000000000000000000",
"ModuleRegistry": "0x022DBAAeA5D8fB31a0Ad793335e39Ced5D631fa5",
"PILicenseTemplate": "0x2E896b0b2Fdb7457499B56AAaA4AE55BCB4Cd316",
"ProtocolAccessManager": "0xFdece7b8a2f55ceC33b53fd28936B4B1e3153d53",
"ProtocolPauseAdmin": "0xdd661f55128A80437A0c0BDA6E13F214A3B2EB24",
"RoyaltyModule": "0xD2f60c40fEbccf6311f8B47c4f2Ec6b040400086",
"RoyaltyPolicyLAP": "0xBe54FB168b3c982b7AaE60dB6CF75Bd8447b390E",
"RoyaltyPolicyLRP": "0x9156e603C949481883B1d3355c6f1132D191fC41"
}
}'
echo $PROTOCOL_ADDRESS > ./node_modules/@story-protocol/protocol-core/deploy-out/deployment-${{ needs.set-devnet-constants.outputs.CHAINID }}.json
- name: Set Periphery Addresses
run: |
PERIPHERY_ADDRESS='{
"main": {
"DerivativeWorkflows": "0x9e2d496f72C547C2C535B167e06ED8729B374a4f",
"GroupingWorkflows": "0xD7c0beb3aa4DCD4723465f1ecAd045676c24CDCd",
"LicenseAttachmentWorkflows": "0xcC2E862bCee5B6036Db0de6E06Ae87e524a79fd8",
"OwnableERC20Beacon": "0x9a81C447C0b4C47d41d94177AEea3511965d3Bc9",
"OwnableERC20Template": "0x58f38BadFdF6580bA5bC4b9eEd5d7262A765dde4",
"RegistrationWorkflows": "0xbe39E1C756e921BD25DF86e7AAa31106d1eb0424",
"RoyaltyTokenDistributionWorkflows": "0xa38f42B8d33809917f23997B8423054aAB97322C",
"RoyaltyWorkflows": "0x9515faE61E0c0447C6AC6dEe5628A2097aFE1890",
"SPGNFTBeacon": "0xD2926B9ecaE85fF59B6FB0ff02f568a680c01218",
"SPGNFTImpl": "0x6Cfa03Bc64B1a76206d0Ea10baDed31D520449F5",
"TokenizerModule": "0xAC937CeEf893986A026f701580144D9289adAC4C",
"TotalLicenseTokenLimitHook": "0xB72C9812114a0Fc74D49e01385bd266A75960Cda"
}
}'
devnet_version="${{ inputs.devnet_version || github.event.inputs.devnet_version || 'internal-devnet' }}"
if [[ "$devnet_version" == "internal-devnet" ]]; then
echo $PERIPHERY_ADDRESS > ./deploy-out/deployment-${{ needs.set-devnet-constants.outputs.CHAINID }}.json
fi
- name: Build Contracts
run: |
forge build
- name: Run DerivativeIntegration Tests
if: always() && !cancelled()
run: |
forge script test/integration/workflows/DerivativeIntegration.t.sol:DerivativeIntegration --rpc-url=${{ env.RPC_URL }} -vvv --broadcast --priority-gas-price=1 --legacy --skip-simulation
- name: Run GroupingIntegration Tests
if: always() && !cancelled()
run: |
forge script test/integration/workflows/GroupingIntegration.t.sol:GroupingIntegration --rpc-url=${{ env.RPC_URL }} -vvv --broadcast --priority-gas-price=1 --legacy --skip-simulation >> test-results.log
- name: Run LicenseAttachmentIntegration Tests
if: always() && !cancelled()
id: license_attachment_test
continue-on-error: true
run: |
forge script test/integration/workflows/LicenseAttachmentIntegration.t.sol:LicenseAttachmentIntegration --rpc-url=${{ env.RPC_URL }} -vvv --broadcast --priority-gas-price=1 --legacy --skip-simulation > license_attachment_test.log
- name: Check LicenseAttachmentIntegration Results and Append Log
if: always() && !cancelled()
run: |
cat license_attachment_test.log >> test-results.log
if [[ "${{ steps.license_attachment_test.outcome }}" == "failure" ]]; then
if grep -q "SUCCESS: Correctly reverted when exceeding the token limit." license_attachment_test.log; then
echo "✅ Transaction failed as expected. Continuing workflow."
exit 0
else
echo "❌ Transaction failed with an unexpected error."
exit 1
fi
fi
- name: Run RegistrationIntegration Tests
if: always() && !cancelled()
run: |
forge script test/integration/workflows/RegistrationIntegration.t.sol:RegistrationIntegration --rpc-url=${{ env.RPC_URL }} -vvv --broadcast --priority-gas-price=1 --legacy --skip-simulation >> test-results.log
- name: Run RoyaltyIntegration Tests
if: always() && !cancelled()
run: |
forge script test/integration/workflows/RoyaltyIntegration.t.sol:RoyaltyIntegration --rpc-url=${{ env.RPC_URL }} -vvv --broadcast --priority-gas-price=1 --legacy --skip-simulation >> test-results.log
- name: Run RoyaltyTokenDistributionIntegration Tests
if: always() && !cancelled()
run: |
forge script test/integration/workflows/RoyaltyTokenDistributionIntegration.t.sol:RoyaltyTokenDistributionIntegration --rpc-url=${{ env.RPC_URL }} -vvv --broadcast --priority-gas-price=1 --legacy --skip-simulation >> test-results.log
- name: Merge Test Results
run: |
cat test-results.log
- name: Upload Test Report
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: |
./test-results.log
./license_attachment_test.log