diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41b7dd1..2b8131b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,80 +1,13 @@ -name: Typescript CI Workflow +name: Node CI Workflow on: push: branches: - - dev + - main pull_request: branches: - - dev + - main jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4.0.0 - - - name: Set up Node.js - uses: actions/setup-node@v4.0.0 - with: - node-version: '${{ vars.NODE_VERSION }}' - cache: 'npm' - - - name: Install dependencies - run: | - echo "Installing dependencies..." - npm ci --ignore-scripts - echo "Dependency installation complete." - - - name: Lint - id: lint - run: | - echo "Running Linter..." - npm run lint - echo "Running Linter complete." - continue-on-error: true - - - name: Format check - id: format_check - run: | - echo "Running format check..." - npm run format-check - echo "Format check complete." - continue-on-error: true - - - name: Test apply patches - id: test_apply_patches - run: | - set -e - shopt -s nullglob - patches=(*.patch) - if [ ${#patches[@]} -eq 0 ]; then - echo "No patches to test." - else - for patch in "${patches[@]}"; do - echo "Testing $patch" - git apply --check -v "$patch" || (echo "Failed to apply patch: $patch" && exit 1) - done - echo "All patches applied successfully." - fi - continue-on-error: true - - - name: Build - id: build - run: | - echo "Building the code..." - npm run build - echo "Build complete." - - - name: Unit Tests - id: unit_tests - run: | - echo "Running Unit Tests..." - npm test - echo "Unit Tests complete." - - - name: Check if any step failed - if: ${{ steps.lint.outcome == 'failure' || steps.format_check.outcome == 'failure' || steps.test_apply_patches.outcome == 'failure' }} - run: exit 1 + ci: + uses: shardeum/github-automation/.github/workflows/node-ci-shared.yml@dev \ No newline at end of file