Skip to content

Commit b070647

Browse files
committed
ci: expand combinations for testnet tests
1 parent 37b4a8e commit b070647

File tree

5 files changed

+70
-22
lines changed

5 files changed

+70
-22
lines changed

.github/workflows/_test.yml

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,19 @@ on:
88
ignore-scripts:
99
type: boolean
1010
default: false
11+
protocol:
12+
# RPC, WS
13+
type: string
14+
node:
15+
# Juno, Pathfinder
16+
type: string
17+
version:
18+
# vX_Y
19+
type: string
1120
secrets:
12-
TEST_RPC_URL:
21+
TEST_NODE_URL:
22+
required: false
23+
TEST_WS_JUNO:
1324
required: false
1425
TEST_ACCOUNT_PRIVATE_KEY:
1526
required: false
@@ -29,12 +40,15 @@ jobs:
2940
- 5050:5050
3041

3142
env:
32-
TEST_RPC_URL: ${{ secrets.TEST_RPC_URL }}
43+
PROTOCOL: ${{ inputs.protocol == 'WS' && 'wss' || 'https' }}
44+
NODE: ${{ inputs.node == 'Juno' && 'juno' || inputs.node == 'Pathfinder' && 'pathfinder' || '' }}
45+
VERSION: ${{ inputs.version }}
46+
47+
NODE_URL: ${{ secrets.TEST_NODE_URL }}
3348
TEST_ACCOUNT_PRIVATE_KEY: ${{ secrets.TEST_ACCOUNT_PRIVATE_KEY }}
3449
TEST_ACCOUNT_ADDRESS: ${{ secrets.TEST_ACCOUNT_ADDRESS }}
3550

3651
steps:
37-
- run: echo ${{ secrets.TEST_RPC_URL }}
3852
- uses: actions/checkout@v4
3953
- uses: actions/setup-node@v4
4054
with:
@@ -43,4 +57,21 @@ jobs:
4357
- run: npm ci --ignore-scripts
4458
- run: npm run pretest && npm run posttest
4559
if: ${{ !inputs.ignore-scripts }}
46-
- run: npm run test:coverage
60+
- id: env-modification
61+
name: env modification
62+
run: |
63+
echo "::add-mask::$FORMATED_URL"
64+
echo "NODE_URL=$FORMATED_URL" >> "$GITHUB_OUTPUT"
65+
env:
66+
FORMATED_URL: ${{ format(env.NODE_URL, env.PROTOCOL, env.NODE, env.VERSION) }}
67+
- id: run-tests
68+
name: run tests
69+
run: |
70+
args=()
71+
[[ "${{ inputs.protocol }}" == "WS" ]] && args+=( '__tests__/WebSocket' )
72+
npm run test:coverage "${args[@]}"
73+
env:
74+
TEST_RPC_URL: ${{ inputs.protocol != 'WS' && steps.env-modification.outputs.NODE_URL || null }}
75+
TEST_WS_URL: ${{ inputs.protocol == 'WS' && (env.NODE == 'juno' && secrets.TEST_WS_JUNO || steps.env-modification.outputs.NODE_URL) || null }}
76+
TEST_ACCOUNT_PRIVATE_KEY: ${{ secrets.TEST_ACCOUNT_PRIVATE_KEY }}
77+
TEST_ACCOUNT_ADDRESS: ${{ secrets.TEST_ACCOUNT_ADDRESS }}

.github/workflows/manual-tests-devnet.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ jobs:
1515
matrix:
1616
include:
1717
- name: rpc-devnet
18-
TEST_RPC_URL: http://127.0.0.1:5050/rpc
18+
TEST_NODE_URL: http://127.0.0.1:5050/rpc
1919

2020
uses: ./.github/workflows/_test.yml
2121
with:
22-
use-devnet: ${{ matrix.TEST_RPC_URL != '' }}
22+
use-devnet: ${{ matrix.TEST_NODE_URL != '' }}
2323
ignore-scripts: ${{ inputs.ignore-scripts }}
2424
secrets:
25-
TEST_RPC_URL: ${{ matrix.TEST_RPC_URL }}
25+
TEST_NODE_URL: ${{ matrix.TEST_NODE_URL }}

.github/workflows/manual-tests-testnet.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,29 @@ on:
66
description: 'Ignore scripts'
77
type: boolean
88
default: false
9+
fail-fast:
10+
description: 'Fail fast'
11+
type: boolean
12+
default: false
913

1014
jobs:
1115
tests:
12-
name: Run test on ${{ matrix.name }}
16+
name: Run test on ${{ matrix.node }} ${{ matrix.protocol }} ${{ matrix.version }}
1317
strategy:
1418
max-parallel: 1
19+
fail-fast: ${{ inputs.fail-fast }}
1520
matrix:
16-
name: [rpc-sepolia]
21+
protocol: [RPC, WS]
22+
node: [Juno, Pathfinder]
23+
version: [v0_7, v0_8]
24+
exclude:
25+
- version: v0_7
26+
protocol: WS
1727

1828
uses: ./.github/workflows/_test.yml
1929
with:
2030
ignore-scripts: ${{ inputs.ignore-scripts }}
21-
secrets:
22-
TEST_RPC_URL: ${{ secrets.TEST_RPC_URL }}
23-
TEST_ACCOUNT_PRIVATE_KEY: ${{ secrets.TEST_ACCOUNT_PRIVATE_KEY }}
24-
TEST_ACCOUNT_ADDRESS: ${{ secrets.TEST_ACCOUNT_ADDRESS }}
31+
protocol: ${{ matrix.protocol }}
32+
node: ${{ matrix.node }}
33+
version: ${{ matrix.version }}
34+
secrets: inherit

.github/workflows/pr-push-dev.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ jobs:
4646
matrix:
4747
include:
4848
- name: rpc-devnet
49-
TEST_RPC_URL: http://127.0.0.1:5050/rpc
49+
TEST_NODE_URL: http://127.0.0.1:5050/rpc
5050

5151
uses: ./.github/workflows/_test.yml
5252
with:
53-
use-devnet: ${{ matrix.TEST_RPC_URL != '' }}
53+
use-devnet: ${{ matrix.TEST_NODE_URL != '' }}
5454
secrets:
55-
TEST_RPC_URL: ${{ matrix.TEST_RPC_URL }}
55+
TEST_NODE_URL: ${{ matrix.TEST_NODE_URL }}
5656

5757
release:
5858
name: Release

.github/workflows/pr-push-main.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,26 @@ jobs:
3434
cancel_others: 'true'
3535

3636
tests:
37-
name: Run test on ${{ matrix.name }}
37+
name: Run test on ${{ matrix.node }} ${{ matrix.protocol }} ${{ matrix.version }}
3838
needs: [skip_check]
3939
if: needs.skip_check.outputs.should_skip != 'true'
4040
strategy:
4141
max-parallel: 1
42+
fail-fast: false
4243
matrix:
43-
name: [rpc-sepolia]
44+
protocol: [RPC, WS]
45+
node: [Juno, Pathfinder]
46+
version: [v0_7, v0_8]
47+
exclude:
48+
- version: v0_7
49+
protocol: WS
4450

4551
uses: ./.github/workflows/_test.yml
46-
secrets:
47-
TEST_RPC_URL: ${{ secrets.TEST_RPC_URL }}
48-
TEST_ACCOUNT_PRIVATE_KEY: ${{ secrets.TEST_ACCOUNT_PRIVATE_KEY }}
49-
TEST_ACCOUNT_ADDRESS: ${{ secrets.TEST_ACCOUNT_ADDRESS }}
52+
with:
53+
protocol: ${{ matrix.protocol }}
54+
node: ${{ matrix.node }}
55+
version: ${{ matrix.version }}
56+
secrets: inherit
5057

5158
release:
5259
name: Release

0 commit comments

Comments
 (0)