Skip to content

action enhancement

action enhancement #63

name: Hardhat Pipeline
on: [push, pull_request]
env:
DEBUG: '@tenderly/github-action'
## Needed available as env variables for hardhat.config.js
TENDERLY_PROJECT_NAME: ${{ vars.TENDERLY_PROJECT_NAME }}
TENDERLY_ACCOUNT_NAME: ${{ vars.TENDERLY_ACCOUNT_NAME }}
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Setup Virtual TestNet
uses: Tenderly/[email protected]
with:
access_key: ${{ secrets.TENDERLY_ACCESS_KEY }}
project_name: ${{ vars.TENDERLY_PROJECT_NAME }}
account_name: ${{ vars.TENDERLY_ACCOUNT_NAME }}
testnet_name: "Staging TestNet"
network_id: 1
chain_id: 73571
state_sync: true
public_explorer: true
verification_visibility: bytecode
- name: Install dependencies
run: npm install
- name: Run Tests
run: npm run test:vnet
deploy:
needs: test
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Setup Virtual TestNet
uses: Tenderly/[email protected]
with:
access_key: ${{ secrets.TENDERLY_ACCESS_KEY }}
project_name: ${{ vars.TENDERLY_PROJECT_NAME }}
account_name: ${{ vars.TENDERLY_ACCOUNT_NAME }}
testnet_name: "Staging TestNet"
network_id: 1
chain_id: 73571
state_sync: true
public_explorer: true
verification_visibility: bytecode
- name: Install dependencies
run: npm install
- name: Deploy Contracts
run: npm run deploy:vnet