Skip to content

Commit f342758

Browse files
committed
test(ci): add dual RPC v0.7 and v0.8 starknet-go testing in workflows (#2689)
test(ci/starknet-go): support dual RPC v0.7 and v0.8 in workflows - Remove `rpc_version` param from deploy-and-test.yaml to allow testing multiple versions - Add `ref` param to checkout specific starknet.go version (e.g. latest supports only RPC v0.8) - Add temporary logic in starknet.go to set proper env vars (required due to changes in latest starknet.go) - For RPC v0.8, enable and run WebSocket tests using configured secret
1 parent d0d1cfb commit f342758

File tree

4 files changed

+53
-26
lines changed

4 files changed

+53
-26
lines changed

.github/workflows/deploy-and-test.yaml

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ on:
1919
required: true
2020
type: string
2121
description: "Target repository for the image"
22-
rpc_version:
23-
required: false
24-
type: string
25-
default: "v0_7"
2622
test_mode:
2723
required: false
2824
type: string
@@ -35,15 +31,17 @@ on:
3531
required: true
3632
RPC_URL:
3733
required: true
34+
WS_RPC_URL:
35+
required: true
3836
TEST_ACCOUNT_ADDRESS:
3937
required: true
4038
TEST_ACCOUNT_PRIVATE_KEY:
4139
required: true
4240

4341
concurrency:
44-
group: shared_${{ inputs.environment }}_environment
45-
cancel-in-progress: false
46-
42+
group: shared_${{ inputs.environment }}_environment
43+
cancel-in-progress: false
44+
4745
permissions:
4846
contents: read
4947

@@ -97,20 +95,33 @@ jobs:
9795
needs: [deploy]
9896
uses: ./.github/workflows/starknet-rs-tests.yml
9997
secrets:
100-
STARKNET_RPC: ${{ secrets.RPC_URL }}/${{ inputs.rpc_version }}
98+
STARKNET_RPC: ${{ secrets.RPC_URL }}/v0_7
10199

102100
starknet-js:
103101
needs: [deploy]
104102
uses: ./.github/workflows/starknet-js-tests.yml
105103
with:
106104
test_mode: ${{ inputs.test_mode }}
107105
secrets:
108-
TEST_RPC_URL: ${{ secrets.RPC_URL }}/${{ inputs.rpc_version }}
106+
TEST_RPC_URL: ${{ secrets.RPC_URL }}/v0_7
109107
TEST_ACCOUNT_ADDRESS: ${{ secrets.TEST_ACCOUNT_ADDRESS }}
110108
TEST_ACCOUNT_PRIVATE_KEY: ${{ secrets.TEST_ACCOUNT_PRIVATE_KEY }}
111109

112-
starknet-go:
110+
starknet-go-rpcv07:
111+
needs: [deploy]
112+
uses: ./.github/workflows/starknet-go-tests.yml
113+
with:
114+
ref: 1ede19210c10f1f1f9c3cb49a42f737cd90eda5e
115+
rpc_version: v0_7
116+
secrets:
117+
TEST_RPC_URL: ${{ secrets.RPC_URL }}
118+
119+
starknet-go-rpcv08:
113120
needs: [deploy]
114121
uses: ./.github/workflows/starknet-go-tests.yml
122+
with:
123+
ref: 0993fd35590564b0de79f0d757ff2609a5ed0798
124+
rpc_version: v0_8
115125
secrets:
116-
TEST_RPC_URL: ${{ secrets.RPC_URL }}/${{ inputs.rpc_version }}
126+
TEST_RPC_URL: ${{ secrets.RPC_URL }}
127+
TEST_WS_RPC_URL: ${{ secrets.WS_RPC_URL }}

.github/workflows/deploy-dev-and-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ jobs:
3030
environment: Development
3131
source_repo: nubia-oci-local-dev
3232
target_repo: nubia-oci-local-dev
33-
rpc_version: v0_7
3433
test_mode: ${{ github.event_name == 'pull_request' && 'fast' || 'full' }}
3534
secrets:
3635
ARTIFACTORY_NUBIA_USERNAME: ${{ secrets.ARTIFACTORY_NUBIA_USERNAME }}
3736
ARTIFACTORY_NUBIA_TOKEN_DEVELOPER: ${{ secrets.ARTIFACTORY_NUBIA_TOKEN_DEVELOPER }}
3837
RPC_URL: ${{ secrets.DEV_SEPOLIA_URL }}
38+
WS_RPC_URL: ${{ secrets.DEV_WS_SEPOLIA_URL }}
3939
TEST_ACCOUNT_ADDRESS: ${{ secrets.TEST_ACCOUNT_ADDRESS }}
4040
TEST_ACCOUNT_PRIVATE_KEY: ${{ secrets.TEST_ACCOUNT_PRIVATE_KEY }}

.github/workflows/deploy-staging-and-test.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,10 @@ on:
77
description: 'Docker image tag from Dev to promote'
88
required: true
99
type: string
10-
rpc_version:
11-
description: 'RPC version for tests (e.g., v0_7)'
12-
required: true
13-
default: 'v0_7'
14-
type: string
1510

1611
permissions:
1712
contents: read
1813

19-
concurrency:
20-
group: shared_staging_environment
21-
cancel-in-progress: false
22-
2314
jobs:
2415
promote_to_staging:
2516
uses: ./.github/workflows/deploy-and-test.yaml
@@ -28,10 +19,10 @@ jobs:
2819
environment: Staging
2920
source_repo: nubia-oci-local-dev
3021
target_repo: nubia-oci-local-staging
31-
rpc_version: ${{ inputs.rpc_version }}
3222
secrets:
3323
ARTIFACTORY_NUBIA_USERNAME: ${{ secrets.ARTIFACTORY_NUBIA_USERNAME }}
3424
ARTIFACTORY_NUBIA_TOKEN_DEVELOPER: ${{ secrets.ARTIFACTORY_NUBIA_TOKEN_DEVELOPER }}
3525
RPC_URL: ${{ secrets.STAGING_SEPOLIA_URL }}
26+
WS_RPC_URL: ${{ secrets.STAGING_WS_SEPOLIA_URL }}
3627
TEST_ACCOUNT_ADDRESS: ${{ secrets.TEST_ACCOUNT_ADDRESS }}
3728
TEST_ACCOUNT_PRIVATE_KEY: ${{ secrets.TEST_ACCOUNT_PRIVATE_KEY }}

.github/workflows/starknet-go-tests.yml

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,15 @@ on:
88
required: false
99
default: '1ede19210c10f1f1f9c3cb49a42f737cd90eda5e'
1010
type: string
11+
rpc_version:
12+
description: 'The RPC version to test (v0_7 or v0_8)'
13+
required: true
14+
type: string
1115
secrets:
1216
TEST_RPC_URL:
1317
required: true
18+
TEST_WS_RPC_URL:
19+
required: false
1420

1521
jobs:
1622
test:
@@ -30,7 +36,26 @@ jobs:
3036
- name: Install dependencies
3137
run: go mod download
3238

33-
- name: Test RPC on testnet
34-
run: cd rpc && go test -skip 'TestBlockWithReceipts' -timeout 1200s -v -env testnet .
35-
env:
36-
INTEGRATION_BASE: ${{ secrets.TEST_RPC_URL }}
39+
- name: Configure test environment variables
40+
run: |
41+
RPC_URL="${{ secrets.TEST_RPC_URL }}"
42+
VERSION="${{ inputs.rpc_version }}"
43+
44+
if [ "$VERSION" = "v0_7" ]; then
45+
echo "INTEGRATION_BASE=${RPC_URL}/${VERSION}" >> $GITHUB_ENV
46+
elif [ "$VERSION" = "v0_8" ]; then
47+
if [ -z "${{ secrets.TEST_WS_RPC_URL }}" ]; then
48+
echo "Error: TEST_WS_RPC_URL secret must be set for RPC v0_8"
49+
exit 1
50+
fi
51+
echo "HTTP_PROVIDER_URL=${RPC_URL}/${VERSION}" >> $GITHUB_ENV
52+
echo "WS_PROVIDER_URL=${{ secrets.TEST_WS_RPC_URL }}/${VERSION}" >> $GITHUB_ENV
53+
else
54+
echo "Version $VERSION is not supported."
55+
exit 1
56+
fi
57+
58+
- name: Run RPC tests
59+
run: |
60+
cd rpc
61+
go test -timeout 1200s -v -env testnet .

0 commit comments

Comments
 (0)