diff --git a/.github/workflows/ci-cd-pipeline.yml b/.github/workflows/ci-cd-pipeline.yml index cf4033cbd8..f77e0d53de 100644 --- a/.github/workflows/ci-cd-pipeline.yml +++ b/.github/workflows/ci-cd-pipeline.yml @@ -10,7 +10,7 @@ env: on: push: - branches: [main] + branches: [main, wojciechos/starkent-go] tags: ["v*"] workflow_dispatch: @@ -93,6 +93,13 @@ jobs: TEST_ACCOUNT_ADDRESS: ${{ secrets.TEST_ACCOUNT_ADDRESS }} TEST_ACCOUNT_PRIVATE_KEY: ${{ secrets.TEST_ACCOUNT_PRIVATE_KEY }} + dev-starknet-go-tests: + needs: [validate_dev] + 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] runs-on: ubuntu-latest @@ -137,6 +144,13 @@ jobs: TEST_ACCOUNT_ADDRESS: ${{ secrets.TEST_ACCOUNT_ADDRESS }} TEST_ACCOUNT_PRIVATE_KEY: ${{ secrets.TEST_ACCOUNT_PRIVATE_KEY }} + staging-starknet-go-tests: + needs: [promote_to_staging] + 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] runs-on: ubuntu-latest @@ -179,3 +193,10 @@ jobs: TEST_RPC_URL: ${{ secrets.PROD_SEPOLIA_URL }}/v0_7 TEST_ACCOUNT_ADDRESS: ${{ secrets.TEST_ACCOUNT_ADDRESS }} TEST_ACCOUNT_PRIVATE_KEY: ${{ secrets.TEST_ACCOUNT_PRIVATE_KEY }} + + prod-starknet-go-tests: + 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 }} diff --git a/.github/workflows/starknet-go-tests.yml b/.github/workflows/starknet-go-tests.yml new file mode 100644 index 0000000000..b5c6b289d5 --- /dev/null +++ b/.github/workflows/starknet-go-tests.yml @@ -0,0 +1,33 @@ +name: starknet-go tests + +on: + workflow_call: + secrets: + TEST_RPC_URL: + required: false + TEST_ACCOUNT_PRIVATE_KEY: + required: false + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout the repo + uses: actions/checkout@v4 + with: + repository: NethermindEth/starknet.go + ref: main + + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: '1.23' + + - name: Install dependencies + run: go mod download + + - 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 }}