Skip to content

update

update #29

Workflow file for this run

name: πŸš€ TypeScript SDK CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
quality:
name: πŸ” Code Quality
runs-on: ubuntu-latest
steps:
- name: πŸ“₯ Checkout code
uses: actions/checkout@v4
- name: πŸ”§ Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
- name: πŸ“¦ Install dependencies
run: npm ci
- name: 🎨 Check Formatting
run: |
echo "::group::🎨 Prettier Formatting"
npm run format:check
echo "::endgroup::"
- name: πŸ” Run Linting
run: |
echo "::group::πŸ” ESLint Linting"
npm run lint
echo "::endgroup::"
- name: πŸ”¬ Type Checking
run: |
echo "::group::πŸ”¬ TypeScript Type Checking"
npx tsc --noEmit
echo "::endgroup::"
- name: βœ… Quality Summary
if: success()
run: |
echo "::notice::βœ… All code quality checks passed!"
echo "- Formatting: PASSED"
echo "- Linting: PASSED"
echo "- Type checking: PASSED"
test:
name: πŸ§ͺ Test Node.js ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: ['18.20.5', '20.18.1', '22.12.0']
steps:
- name: πŸ“₯ Checkout code
uses: actions/checkout@v4
- name: πŸ”§ Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: πŸ“¦ Install dependencies
run: npm ci
- name: πŸ—οΈ Build package
run: npm run build
- name: πŸ§ͺ Run Core Tests
run: |
echo "::group::πŸ§ͺ Core Tests"
npm run test:core -- --run
echo "::endgroup::"
- name: πŸš€ Run Performance Tests
continue-on-error: true
run: |
echo "::group::πŸš€ Performance Tests"
npm run test:perf -- --run
echo "::endgroup::"
- name: πŸ“Š Generate Coverage Report
if: matrix.node-version == '20.18.1'
run: npm run test:coverage -- --run
- name: πŸ“ˆ Upload Coverage
if: matrix.node-version == '20.18.1'
uses: codecov/codecov-action@v4
with:
files: ./coverage/coverage-final.json
flags: unittests
name: typescript-sdk
fail_ci_if_error: false
build:
name: πŸ—οΈ Build & Package
runs-on: ubuntu-latest
needs: [quality, test]
steps:
- name: πŸ“₯ Checkout code
uses: actions/checkout@v4
- name: πŸ”§ Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
- name: πŸ“¦ Install dependencies
run: npm ci
- name: πŸ—οΈ Build package
run: npm run build
- name: πŸ“¦ Check package
run: |
npm pack --dry-run
echo "βœ… Package is ready for publishing"
- name: πŸ“€ Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
cross-platform:
name: πŸ–₯️ Test ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest]
node-version: ['20.18.1']
steps:
- name: πŸ“₯ Checkout code
uses: actions/checkout@v4
- name: πŸ”§ Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: πŸ“¦ Install dependencies
run: npm ci
- name: πŸ—οΈ Build package
run: npm run build
- name: πŸ§ͺ Run Core Tests
run: npm run test:core -- --run
summary:
name: πŸ“‹ CI Summary
runs-on: ubuntu-latest
needs: [quality, test, build, cross-platform]
if: always()
steps:
- name: πŸ“Š Summary
run: |
echo "## πŸ“‹ CI Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Check | Status |" >> $GITHUB_STEP_SUMMARY
echo "|-------|--------|" >> $GITHUB_STEP_SUMMARY
echo "| πŸ” Code Quality | ${{ needs.quality.result == 'success' && 'βœ… Passed' || '❌ Failed' }} |" >> $GITHUB_STEP_SUMMARY
echo "| πŸ§ͺ Tests | ${{ needs.test.result == 'success' && 'βœ… Passed' || '❌ Failed' }} |" >> $GITHUB_STEP_SUMMARY
echo "| πŸ—οΈ Build | ${{ needs.build.result == 'success' && 'βœ… Passed' || '❌ Failed' }} |" >> $GITHUB_STEP_SUMMARY
echo "| πŸ–₯️ Cross-Platform | ${{ needs.cross-platform.result == 'success' && 'βœ… Passed' || '❌ Failed' }} |" >> $GITHUB_STEP_SUMMARY