Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add starknet.go tests to CI #1881

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 43 additions & 19 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Docker Build, Publish and Deploy

on:
push:
branches: [main]
branches: [main, wojciechos/starknet-go-tests]
tags: ['v*']
workflow_dispatch:

Expand All @@ -27,22 +27,22 @@ jobs:
echo "DOCKER_IMAGE_TAG=$(git describe --tags)" >> $GITHUB_ENV
echo "IMAGE_TAG=$(git describe --tags)" >> "$GITHUB_OUTPUT"

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
# - name: Setup Docker Buildx
# uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# - name: Login to Docker Hub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and Push
uses: docker/build-push-action@v5
with:
context: .
platforms: 'linux/amd64'
push: true
tags: nethermindeth/juno:${{ env.DOCKER_IMAGE_TAG }}
# - name: Build and Push
# uses: docker/build-push-action@v5
# with:
# context: .
# platforms: 'linux/amd64'
# push: true
# tags: nethermindeth/juno:${{ env.DOCKER_IMAGE_TAG }}

deploy_to_dev:
permissions:
Expand Down Expand Up @@ -71,8 +71,8 @@ jobs:
-d '{"event_type": "${{ env.EVENT_NAME }}", "client_payload":{"name": "${{ env.EVENT_NAME }}", "sepolia_config": "${{ env.SEPOLIA }}", "tag": "${{ env.IMAGE_TAG }}"}}'

- name: Verify Deployment Version (Dev)
run: bash .github/workflow-scripts/verify_deployment.sh ${{ secrets.DEV_SEPOLIA_URL }} ${{ needs.docker_build_and_publish.outputs.IMAGE_TAG }}

run: bash .github/workflow-scripts/verify_deployment.sh ${{ secrets.DEV_SEPOLIA_URL }} ${{ needs.docker_build_and_publish.outputs.IMAGE_TAG }}
dev-starknet-rs-tests:
needs: [deploy_to_dev]
uses: ./.github/workflows/starknet-rs-tests.yml
Expand All @@ -86,7 +86,15 @@ jobs:
TEST_RPC_URL: ${{ secrets.DEV_SEPOLIA_URL }}/v0_7
TEST_ACCOUNT_ADDRESS: ${{ secrets.TEST_ACCOUNT_ADDRESS }}
TEST_ACCOUNT_PRIVATE_KEY: ${{ secrets.TEST_ACCOUNT_PRIVATE_KEY }}


dev-starknet-go-tests:
needs: [deploy_to_dev]
uses: ./.github/workflows/starknet-go-tests.yml
secrets:
INTEGRATION_BASE: ${{ secrets.DEV_SEPOLIA_URL }}/v0_7
TESTNET_ACCOUNT_PRIVATE_KEY: ${{ secrets.TEST_ACCOUNT_PRIVATE_KEY }}
NETWORK: testnet

deploy_to_staging:
needs: [docker_build_and_publish, deploy_to_dev]
runs-on: ubuntu-latest
Expand Down Expand Up @@ -128,6 +136,14 @@ jobs:
TEST_RPC_URL: ${{ secrets.STAGING_SEPOLIA_URL }}/v0_7
TEST_ACCOUNT_ADDRESS: ${{ secrets.TEST_ACCOUNT_ADDRESS }}
TEST_ACCOUNT_PRIVATE_KEY: ${{ secrets.TEST_ACCOUNT_PRIVATE_KEY }}

staging-starknet-go-tests:
needs: [deploy_to_dev]
uses: ./.github/workflows/starknet-go-tests.yml
secrets:
INTEGRATION_BASE: ${{ secrets.STAGING_SEPOLIA_URL }}/v0_7
TESTNET_ACCOUNT_PRIVATE_KEY: ${{ secrets.TEST_ACCOUNT_PRIVATE_KEY }}
NETWORK: testnet

deploy_to_production:
needs: [docker_build_and_publish, deploy_to_staging]
Expand Down Expand Up @@ -163,4 +179,12 @@ jobs:
secrets:
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 }}
TEST_ACCOUNT_PRIVATE_KEY: ${{ secrets.TEST_ACCOUNT_PRIVATE_KEY }}

prod-starknet-go-tests:
needs: [deploy_to_production]
uses: ./.github/workflows/starknet-go-tests.yml
secrets:
INTEGRATION_BASE: ${{ secrets.PROD_SEPOLIA_URL }}/v0_7
TESTNET_ACCOUNT_PRIVATE_KEY: ${{ secrets.TEST_ACCOUNT_PRIVATE_KEY }}
NETWORK: testnet
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:
INTEGRATION_BASE:
required: false
TESTNET_ACCOUNT_PRIVATE_KEY:
required: false
NETWORK:
required: false

jobs:
build_and_test:
runs-on: ubuntu-22.04

steps:
- name: Checkout the repo
uses: actions/checkout@v4
with:
repository: NethermindEth/starknet.go

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod

- name: Test RPC on testnet
run: cd rpc && go test -timeout 1200s -v -env ${{ secrets.NETWORK }} .
env:
TESTNET_ACCOUNT_PRIVATE_KEY: ${{ secrets.TESTNET_ACCOUNT_PRIVATE_KEY }}
INTEGRATION_BASE: ${{ secrets.STARKNET_RPC }}
NETWORK: ${{ secrets.NETWORK }}
Loading