Skip to main content
Learn how to integrate OnchainTestKit into your CI/CD pipeline for automated blockchain testing on every commit. The example will likely will be slightly different depending on your project structure.

GitHub Actions

Basic Example Setup

Create .github/workflows/e2e-tests.yml:

Optimization Tips

Always run headless in CI for better performance:
Add smart retry logic for flaky tests:

Troubleshooting

This error occurs when Node.js resolves “localhost” to ::1 (IPv6) but Anvil only listens on IPv4 addresses.Solution: Force Node.js to prefer IPv4 addresses by setting the NODE_OPTIONS environment variable:
This ensures:
  • localhost resolves to 127.0.0.1 (IPv4) instead of ::1 (IPv6)
  • Anvil can properly listen on the resolved address
  • Tests can successfully connect to the local blockchain
E2E tests may become less reliable with increased parallelism, especially when multiple wallet interactions occur simultaneously. This is not an issue locally though.Solutions:
  • Reduce test parallelism in CI environments:
  • Add longer timeouts for wallet operations:
  • Use test isolation to prevent state conflicts:

Next Steps