Skip to content

Commit

Permalink
✅ add build.yml | fix test.js
Browse files Browse the repository at this point in the history
  • Loading branch information
whonion committed Dec 22, 2023
1 parent 4c0bbd7 commit 649c4b6
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: TypeScript Build

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

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

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20

- name: Install Dependencies
run: npm i

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

- name: Build TypeScript
run: tsc --project tsconfig.json
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Status](https://img.shields.io/badge/status-active-success.svg)](https://github.com/whonion/js-sniffer-deployed-contracts/blob/main/) [![Test Run](https://github.com/whonion/js-sniffer-deployed-contracts/actions/workflows/test.yml/badge.svg)](https://github.com/whonion/js-sniffer-deployed-contracts/actions/workflows/test.yml) ![Node Version](https://img.shields.io/badge/Node.js-20.5.1-blue.svg) ![Ethers Version](https://img.shields.io/badge/ethers-5.70-red.svg) ![Axios Version](https://img.shields.io/badge/axios-0.27.2-orange.svg) [![HitCount](https://hits.dwyl.com/whonion/js-sniffer-deployed-contracts.svg)](https://hits.dwyl.com/whonion/js-sniffer-deployed-contracts)</br>
[![Status](https://img.shields.io/badge/status-active-success.svg)](https://github.com/whonion/js-sniffer-deployed-contracts/blob/main/) [![Test Run](https://github.com/whonion/js-sniffer-deployed-contracts/actions/workflows/test.yml/badge.svg)](https://github.com/whonion/js-sniffer-deployed-contracts/actions/workflows/test.yml) [![Build TS](https://github.com/whonion/js-sniffer-deployed-contracts/actions/workflows/build.yml/badge.svg)](https://github.com/whonion/js-sniffer-deployed-contracts/actions/workflows/build.yml) ![Node Version](https://img.shields.io/badge/Node.js-20.5.1-blue.svg) ![Ethers Version](https://img.shields.io/badge/ethers-5.70-red.svg) ![Axios Version](https://img.shields.io/badge/axios-0.27.2-orange.svg) [![HitCount](https://hits.dwyl.com/whonion/js-sniffer-deployed-contracts.svg)](https://hits.dwyl.com/whonion/js-sniffer-deployed-contracts)</br>
## JS Sniffer deployed contracts
This script outputs address,tiker etc. of every new contract deployed on the EVM-based chains.

Expand Down
4 changes: 2 additions & 2 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const childProcess = require("child_process");

const MAX_TEST_DURATION_MS = 120000; // Test duration in milliseconds (e.g., 60 seconds)
const SCRIPT_FILE = "main.js"; // Change this to match your main.js filename
const SCRIPT_FILE = "main.ts"; // Change this to match your main.js filename

// Function to run the main.js script for a specific duration
function runMainScriptForDuration() {
return new Promise((resolve, reject) => {
const process = childProcess.spawn("node", [SCRIPT_FILE]);
const process = childProcess.spawn("ts-node", [SCRIPT_FILE]);

setTimeout(() => {
process.kill(); // Terminate the script after the specified duration
Expand Down

0 comments on commit 649c4b6

Please sign in to comment.