-
Notifications
You must be signed in to change notification settings - Fork 14
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
Tenderly Virtual TestNet CI/CD #9
base: feat/deploy-v2
Are you sure you want to change the base?
Conversation
@gretzke Here's the Tenderly Virtual TestNet GitHub Action workflow! I've tested it with a fork of Uniswap contracts (see example runs here: https://github.com/dzimiks/uniswap-contracts/actions). The workflow is flexible - it's using ETH Mainnet (chain_id: 1) but you can customize it for your setup. You can find more details in the official docs. Let me know if you need any help or have questions about customizing it for your needs! 🙌 |
Use matrix strategy to test your contracts across multiple networks in parallel. This is particularly useful for protocols that deploy across multiple chains and need to ensure consistent behavior. More info here: https://github.com/Tenderly/vnet-github-action?tab=readme-ov-file#advanced-configuration. jobs:
test:
strategy:
matrix:
network: ['1', '137', '42161'] # Ethereum, Polygon, Arbitrum
steps:
- uses: Tenderly/[email protected]
with:
network_id: ${{ matrix.network }}
chain_id: ${{ format('7357{0}', matrix.network) }} |
@dzimiks does this also handle EVMs that behave abnormally like zksync? |
Hey @gretzke! Could you explain more about what you mean by that? Just so you know - we support a wide range of networks including ETH, Polygon, Arbitrum, Optimism, Base, and others (full list here: https://docs.tenderly.co/supported-networks) and we're adding new ones almost weekly. Our VNet's advanced config lets you customize chain behavior and handle various EVM quirks. Super interested to hear what specific behaviors you're looking to test! |
Description
The Tenderly/vnet-github-action automates provisioning of Virtual TestNets for smart contract CI/CD pipelines. Virtual TestNets are testing and staging infrastructure with built Mainnet State Sync, Unlimited Faucet, Debugger, and Public Block Explorer.
This action creates a new Virtual TestNet from your configuration and exposes its RPC URLs through environment variables, enabling automated testing and staging environments for Uniswap protocol.
This action enables:
Quick Setup
Step 1: Configure GitHub Action
These are the different inputs that can be configured:
The example below will deploy Smart Contracts to Tenderly Virtual TestNet on ETH Mainnet network.
Step 2: Set Your Secrets
GitHub Secrets (Settings → Secrets and variables → Actions → New repository secret):
TENDERLY_ACCESS_KEY
PRIVATE_KEY
ETHERSCAN_API_KEY
GitHub Variables (Settings → Secrets and variables → Actions → Variables → New repository variable):
TENDERLY_PROJECT_SLUG
TENDERLY_ACCOUNT_SLUG
ADMIN_WALLET
This code example will fund your deployment wallet address with 1000 ETH and deploy the contracts using
Deploy-all.s.sol
Foundry script:How Has This Been Tested?
Here's a concise setup overview for testing:
Prerequisites
Testing Process
Tests run automatically on PR creation:
You can track test runs:
Multi-Network Testing
Need help? Drop an issue or check Tenderly Virtual TestNet Docs.
Checklist:
Before deployment
After deployment
Considerations
forge fmt
and prettier to ensure the code style is validAdditional context
Add any other context about the pull request here.