Skip to content

Commit

Permalink
✅ update test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
whonion committed Dec 23, 2023
1 parent 4351f94 commit 9ab0414
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 10 deletions.
47 changes: 39 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,51 @@
name: Test

on: [push]
on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: ['18.x', '19.x', '20.x']

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install Dependencies
run: npm install

- name: Set Global TypeScript
run: npm install -g typescript

- name: Build TypeScript
run: tsc --project tsconfig.json

test:
needs: build
runs-on: ubuntu-latest

strategy:
matrix:
node-version: ['18.x', '19.x', '20.x']
env: # Set environment variables from repository secrets

env:
ETHERSCANKEY: ${{ secrets.ETHERSCANKEY }}
RPCURL: ${{ secrets.RPCURL }}
EXP_URL: 'https://etherscan.io'


timeout-minutes: 2

steps:
- name: Checkout Repository
uses: actions/checkout@v2
Expand All @@ -25,7 +56,7 @@ jobs:
node-version: ${{ matrix.node-version }}

- name: Install Dependencies
run: npm i
run: npm install

- name: Test Run
run: node test.js
- name: Run TypeScript Test
run: node js/main.js
5 changes: 3 additions & 2 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ async function main() {
try {
const network = await provider.getNetwork();
const chainId: number = network.chainId;
const network_name = network.name;

console.log(`📶 Connected to chainId: ${chainId}`);
console.log(`📶 Connected to ${network_name} (${chainId})`);

// Subscribe to new block events
provider.on("block", async (blockNumber: number) => {
Expand Down Expand Up @@ -51,7 +52,7 @@ async function main() {
}

async function analyzeContract(contractAddress: string, abi: any) {
console.log("️ Analyzing contract:", contractAddress);
console.log("️ Analyzing contract:", contractAddress);
const contract = new ethers.Contract(contractAddress, abi, provider);

const [name, symbol, owner, totalSupply] = await Promise.all([
Expand Down

0 comments on commit 9ab0414

Please sign in to comment.