Skip to content
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

ci: added CI workflow for ERC registry tool #1168

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/erc-registry-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: ERC Registry Tool Test

on:
pull_request:
branches: [main, release/**]
push:
branches: [main, release/**]
tags: [v*]

jobs:
run-test:
name: ERC Registry Tool
runs-on: smart-contracts-linux-large
env:
INDEXER_PATH: ./tools/erc-repository-indexer/erc-contract-indexer
steps:
- name: Harden Runner
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive

- name: Use Node.js [20]
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 20

- name: Create .env file
run: cp ${{env.INDEXER_PATH}}/local.env ${{env.INDEXER_PATH}}/.env

- name: Install Dependencies
run: |
npm ci
cd ${{env.INDEXER_PATH}}
npm install

- name: Run Unit Tests
run: |
cd ${{env.INDEXER_PATH}}
npm run test:unit

- name: Start the local node
run: npx hedera start -d --verbose=trace
timeout-minutes: 5

- name: Run Acceptance Tests
run: |
cd ${{env.INDEXER_PATH}}
npm run test:acceptance

- name: Stop the local node
if: ${{ !cancelled() }}
run: npx hedera stop
5 changes: 5 additions & 0 deletions tools/erc-repository-indexer/erc-contract-indexer/local.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
HEDERA_NETWORK=local-node
MIRROR_NODE_URL=http://127.0.0.1:5551
MIRROR_NODE_URL_WEB3=http://127.0.0.1:8545
SDK_OPERATOR_ID=0.0.1022
SDK_OPERATOR_KEY=302e020100300506032b657004220420a608e2130a0a3cb34f86e757303c862bee353d9ab77ba4387ec084f881d420d4
Loading