From 1b89289fefd69500fabde9e7b37d250b7a424887 Mon Sep 17 00:00:00 2001 From: wojo Date: Wed, 18 Sep 2024 10:24:48 +0200 Subject: [PATCH] Improve starknet-go-tests workflow flexibility and security - Make TEST_RPC_URL and TEST_ACCOUNT_PRIVATE_KEY secrets required - Add 'ref' input parameter to allow testing different branches/tags --- .github/workflows/ci-cd-pipeline.yml | 5 +---- .github/workflows/starknet-go-tests.yml | 13 ++++++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci-cd-pipeline.yml b/.github/workflows/ci-cd-pipeline.yml index 63e7c863e8..c935babb7a 100644 --- a/.github/workflows/ci-cd-pipeline.yml +++ b/.github/workflows/ci-cd-pipeline.yml @@ -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] @@ -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] @@ -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 \ No newline at end of file diff --git a/.github/workflows/starknet-go-tests.yml b/.github/workflows/starknet-go-tests.yml index b5c6b289d5..f0c166a5a4 100644 --- a/.github/workflows/starknet-go-tests.yml +++ b/.github/workflows/starknet-go-tests.yml @@ -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: @@ -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 @@ -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 }}