From 156aa238b94107ad4d1197c8c7a8ba96988a4403 Mon Sep 17 00:00:00 2001 From: Logan Nguyen Date: Mon, 13 Jan 2025 16:53:39 -0600 Subject: [PATCH 1/3] ci: added CI workflow for ERC registry tool Signed-off-by: Logan Nguyen --- .github/workflows/erc-registry-test.yml | 57 +++++++++++++++++++ .../erc-contract-indexer/local.env | 5 ++ 2 files changed, 62 insertions(+) create mode 100644 .github/workflows/erc-registry-test.yml create mode 100644 tools/erc-repository-indexer/erc-contract-indexer/local.env diff --git a/.github/workflows/erc-registry-test.yml b/.github/workflows/erc-registry-test.yml new file mode 100644 index 000000000..240676e14 --- /dev/null +++ b/.github/workflows/erc-registry-test.yml @@ -0,0 +1,57 @@ +name: ERC Registry Tool + +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:unit + + - name: Stop the local node + if: ${{ !cancelled() }} + run: npx hedera stop diff --git a/tools/erc-repository-indexer/erc-contract-indexer/local.env b/tools/erc-repository-indexer/erc-contract-indexer/local.env new file mode 100644 index 000000000..c4c7a90ce --- /dev/null +++ b/tools/erc-repository-indexer/erc-contract-indexer/local.env @@ -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 From fc9210505106d3645c61bc9c22d0bae308dc9d24 Mon Sep 17 00:00:00 2001 From: Logan Nguyen Date: Mon, 13 Jan 2025 16:58:18 -0600 Subject: [PATCH 2/3] Update erc-registry-test.yml Signed-off-by: Logan Nguyen Revert "Update erc-registry-test.yml" This reverts commit e99bec81225ee4904e8a320e8dea27b5287ba76a. Reapply "Update erc-registry-test.yml" This reverts commit f6fab40ff567c86f177c22864cde7b3dc135b27a. --- .github/workflows/erc-registry-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/erc-registry-test.yml b/.github/workflows/erc-registry-test.yml index 240676e14..270104ffa 100644 --- a/.github/workflows/erc-registry-test.yml +++ b/.github/workflows/erc-registry-test.yml @@ -50,7 +50,7 @@ jobs: - name: Run Acceptance Tests run: | cd ${{env.INDEXER_PATH}} - npm run test:unit + npm run test:acceptance - name: Stop the local node if: ${{ !cancelled() }} From 81b964be6ffaa0efa841ebd926b80676d8595950 Mon Sep 17 00:00:00 2001 From: Logan Nguyen Date: Mon, 13 Jan 2025 18:57:28 -0500 Subject: [PATCH 3/3] fix: renamed workflow Signed-off-by: Logan Nguyen Co-authored-by: Luis Mastrangelo Signed-off-by: Logan Nguyen --- .github/workflows/erc-registry-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/erc-registry-test.yml b/.github/workflows/erc-registry-test.yml index 270104ffa..299280fdd 100644 --- a/.github/workflows/erc-registry-test.yml +++ b/.github/workflows/erc-registry-test.yml @@ -1,4 +1,4 @@ -name: ERC Registry Tool +name: ERC Registry Tool Test on: pull_request: