Skip to content

Commit

Permalink
Add Starknet Go tests to CI/CD pipeline
Browse files Browse the repository at this point in the history
- Integrate starknet-go-tests workflow into development, staging, and production stages
- Mirror the structure used for Rust and JavaScript tests
- Use appropriate RPC URLs and account private keys for each environment
- Ensure Go tests run after validation/promotion in each stage
  • Loading branch information
wojciechos committed Sep 13, 2024
1 parent 153e651 commit 06a1978
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
23 changes: 22 additions & 1 deletion .github/workflows/ci-cd-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:

on:
push:
branches: [main]
branches: [main, wojciechos/starkent-go]
tags: ["v*"]
workflow_dispatch:

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
33 changes: 33 additions & 0 deletions .github/workflows/starknet-go-tests.yml
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit 06a1978

Please sign in to comment.