Skip to content

Commit e9dd737

Browse files
Cherry pick commits to mainnet-launch branch (#8)
* cherry picks fix: add initial workflow and tests * Update ci.yml (#6) * Fixup scripts * Update deps --------- Co-authored-by: Zachary Belford <belfordz66@gmail.com>
1 parent cb91908 commit e9dd737

File tree

6 files changed

+8646
-3896
lines changed

6 files changed

+8646
-3896
lines changed

.github/workflows/ci.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Node CI Workflow
2+
#
3+
# The parameters are defaulted at the org level but can be overridden on the repository.
4+
# See the github-automation repo for more documentation
5+
#
6+
on:
7+
push:
8+
branches:
9+
- dev
10+
- main
11+
pull_request:
12+
branches:
13+
- '**'
14+
issue_comment:
15+
types: [created]
16+
workflow_dispatch:
17+
inputs:
18+
workflowBranch:
19+
description: "Branch of the reusable workflow. Defaults to main, select dev for testing only."
20+
required: true
21+
default: "main"
22+
type: choice
23+
options:
24+
- dev
25+
- main
26+
jobs:
27+
echo-inputs:
28+
name: Repo Workflow Debugging
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Check Repo Vars
32+
run: |
33+
echo "*** Start - Check inputs in repo workflow ***"
34+
echo "Node Version: ${{ vars.NODE_VERSION }}"
35+
echo "Lint Required: ${{ vars.IS_LINT_REQUIRED }}"
36+
echo "Format Check Required: ${{ vars.IS_FORMAT_CHECK_REQUIRED }}"
37+
echo "Apply Patches Required: ${{ vars.IS_APPLY_PATCHES_REQUIRED }}"
38+
echo "Unit Tests Required: ${{ vars.IS_UNIT_TESTS_REQUIRED }}"
39+
echo "*** End - Check inputs in repo workflow ***"
40+
ci-test-only:
41+
if: ${{ github.event.inputs.workflowBranch == 'dev' }}
42+
uses: shardeum/github-automation/.github/workflows/reusable-node-ci.yml@dev
43+
permissions:
44+
issues: write
45+
pull-requests: write
46+
contents: write
47+
with:
48+
node-version: ${{ vars.NODE_VERSION }}
49+
lint-required: ${{ vars.IS_LINT_REQUIRED == 'true' }}
50+
format-check-required: ${{ vars.IS_FORMAT_CHECK_REQUIRED == 'true' }}
51+
apply-patches-required: ${{ vars.IS_APPLY_PATCHES_REQUIRED == 'true' }}
52+
unit-tests-required: ${{ vars.IS_UNIT_TESTS_REQUIRED == 'true' }}
53+
secrets: inherit
54+
55+
ci:
56+
if: ${{ github.event.inputs.workflowBranch == 'main' || !github.event.inputs.workflowBranch }}
57+
uses: shardeum/github-automation/.github/workflows/reusable-node-ci.yml@main
58+
permissions:
59+
issues: write
60+
pull-requests: write
61+
contents: write
62+
with:
63+
node-version: ${{ vars.NODE_VERSION }}
64+
lint-required: ${{ vars.IS_LINT_REQUIRED == 'true' }}
65+
format-check-required: ${{ vars.IS_FORMAT_CHECK_REQUIRED == 'true' }}
66+
apply-patches-required: ${{ vars.IS_APPLY_PATCHES_REQUIRED == 'true' }}
67+
unit-tests-required: ${{ vars.IS_UNIT_TESTS_REQUIRED == 'true' }}
68+
secrets: inherit

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
node_modules/
2-
build
2+
build
3+
coverage/
4+
.env

jest.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
testEnvironment: 'node',
3+
testMatch: ['**/__tests__/**/*.js', '**/?(*.)+(spec|test).js'],
4+
testPathIgnorePatterns: ['/node_modules/', './test.js'],
5+
collectCoverage: true,
6+
coverageDirectory: 'coverage',
7+
coverageReporters: ['json', 'lcov', 'text', 'json-summary'],
8+
verbose: true,
9+
testTimeout: 10000, // Increased timeout for async operations
10+
};

0 commit comments

Comments
 (0)