Skip to content

Commit

Permalink
Improve starknet-go-tests workflow flexibility and security
Browse files Browse the repository at this point in the history
- Make TEST_RPC_URL and TEST_ACCOUNT_PRIVATE_KEY secrets required
- Add 'ref' input parameter to allow testing different branches/tags
  • Loading branch information
wojciechos authored and derrix060 committed Oct 3, 2024
1 parent 3e1044d commit 1b89289
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/ci-cd-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ jobs:
uses: ./.github/workflows/starknet-go-tests.yml
secrets:
TEST_RPC_URL: ${{ secrets.DEV_SEPOLIA_URL }}/v0_7
TEST_ACCOUNT_PRIVATE_KEY: ${{ secrets.TEST_ACCOUNT_PRIVATE_KEY }}

promote_to_staging:
needs: [build_docker_image, validate_dev]
Expand Down Expand Up @@ -145,7 +144,6 @@ jobs:
uses: ./.github/workflows/starknet-go-tests.yml
secrets:
TEST_RPC_URL: ${{ secrets.STAGING_SEPOLIA_URL }}/v0_7
TEST_ACCOUNT_PRIVATE_KEY: ${{ secrets.TEST_ACCOUNT_PRIVATE_KEY }}

promote_to_production:
needs: [build_docker_image, promote_to_staging]
Expand Down Expand Up @@ -195,5 +193,4 @@ jobs:
needs: [test_in_production]
uses: ./.github/workflows/starknet-go-tests.yml
secrets:
TEST_RPC_URL: ${{ secrets.PROD_SEPOLIA_URL }}/v0_7
TEST_ACCOUNT_PRIVATE_KEY: ${{ secrets.TEST_ACCOUNT_PRIVATE_KEY }}
TEST_RPC_URL: ${{ secrets.PROD_SEPOLIA_URL }}/v0_7
13 changes: 8 additions & 5 deletions .github/workflows/starknet-go-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ name: starknet-go tests

on:
workflow_call:
inputs:
ref:
description: 'The branch, tag or SHA to checkout'
required: false
default: 'v0.7.1'
type: string
secrets:
TEST_RPC_URL:
required: false
TEST_ACCOUNT_PRIVATE_KEY:
required: false
required: true

jobs:
test:
Expand All @@ -16,7 +20,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: NethermindEth/starknet.go
ref: main
ref: ${{ inputs.ref }}

- name: Setup Go
uses: actions/setup-go@v4
Expand All @@ -29,5 +33,4 @@ jobs:
- name: Test RPC on testnet
run: cd rpc && go test -timeout 1200s -v -env testnet .
env:
TESTNET_ACCOUNT_PRIVATE_KEY: ${{ secrets.TEST_ACCOUNT_PRIVATE_KEY }}
INTEGRATION_BASE: ${{ secrets.TEST_RPC_URL }}

0 comments on commit 1b89289

Please sign in to comment.