chore(deps): bump commander from 11.1.0 to 14.0.2 in /packages/js #67
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| # TypeScript/JavaScript Tests | |
| test-typescript: | |
| name: Test TypeScript (Node ${{ matrix.node-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [18, 20, 22] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: npm | |
| cache-dependency-path: packages/js/package-lock.json | |
| - name: Install dependencies | |
| run: | | |
| cd packages/js | |
| npm ci | |
| - name: Run linter | |
| run: | | |
| cd packages/js | |
| npm run lint | |
| - name: Type check | |
| run: | | |
| cd packages/js | |
| npm run typecheck | |
| - name: Run tests | |
| run: | | |
| cd packages/js | |
| npm test -- --coverage | |
| - name: Upload coverage | |
| if: matrix.node-version == 20 | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| files: ./packages/js/coverage/lcov.info | |
| flags: typescript | |
| name: typescript-coverage | |
| # Python Tests | |
| test-python: | |
| name: Test Python (${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.9", "3.10", "3.11", "3.12"] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Setup Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| cd packages/python | |
| pip install --upgrade pip | |
| pip install -e ".[dev]" | |
| - name: Run linter (ruff) | |
| run: | | |
| cd packages/python | |
| ruff check hogtyped/ || true | |
| - name: Run type checker (mypy) | |
| run: | | |
| cd packages/python | |
| mypy hogtyped/ --ignore-missing-imports || true | |
| - name: Run tests | |
| run: | | |
| cd packages/python | |
| pytest -v --cov=hogtyped --cov-report=xml | |
| - name: Upload coverage | |
| if: matrix.python-version == '3.11' | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| files: ./packages/python/coverage.xml | |
| flags: python | |
| name: python-coverage | |
| # Integration tests - test generated code works | |
| test-integration: | |
| name: Integration Tests | |
| runs-on: ubuntu-latest | |
| needs: [test-typescript, test-python] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.11" | |
| - name: Install TypeScript package | |
| run: | | |
| cd packages/js | |
| npm ci | |
| npm run build | |
| - name: Install Python package | |
| run: | | |
| cd packages/python | |
| pip install -e . | |
| - name: Test TypeScript code generation | |
| run: | | |
| cd packages/js | |
| npx hogtyped init | |
| npx hogtyped generate -o test.generated.ts | |
| npx tsc test.generated.ts --noEmit --skipLibCheck | |
| - name: Test Python code generation | |
| run: | | |
| cd packages/python | |
| python -m hogtyped init | |
| python -m hogtyped generate -o test_generated.py | |
| python -m py_compile test_generated.py | |
| - name: Test cross-compatibility | |
| run: | | |
| # Both should generate from same schemas | |
| mkdir -p test-cross | |
| cp test-schemas/*.json test-cross/ | |
| cd test-cross | |
| node ../packages/js/bin/hogtyped.js generate -s "*.json" -o ts_output.ts | |
| python -m hogtyped generate -s "*.json" -o py_output.py | |
| # Verify both generated files exist | |
| test -f ts_output.ts | |
| test -f py_output.py | |
| # Check that all example code works | |
| test-examples: | |
| name: Test Examples | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.11" | |
| - name: Build packages | |
| run: | | |
| cd packages/js | |
| npm ci | |
| npm run build | |
| cd ../python | |
| pip install -e . | |
| - name: Test generated example | |
| run: | | |
| cd examples/generated | |
| npm install | |
| npm run generate | |
| npm run build | |
| - name: Test Node.js example | |
| run: | | |
| cd examples/node | |
| mkdir -p lib | |
| node ../../packages/js/bin/hogtyped.js generate -o lib/posthog.generated.ts | |
| # Verify file was generated successfully | |
| test -f lib/posthog.generated.ts && echo "✓ Generated lib/posthog.generated.ts" | |
| - name: Test Python example | |
| run: | | |
| cd examples/python | |
| python -m hogtyped generate | |
| python -m py_compile posthog_generated.py | |
| # Build and validate package publishing | |
| test-build: | |
| name: Test Package Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.11" | |
| - name: Build TypeScript package | |
| run: | | |
| cd packages/js | |
| npm ci | |
| npm run build | |
| npm pack --dry-run | |
| - name: Build Python package | |
| run: | | |
| cd packages/python | |
| pip install --upgrade pip build | |
| python -m build | |
| pip install dist/*.whl | |
| - name: Validate package contents | |
| run: | | |
| # Check TypeScript package | |
| cd packages/js | |
| npm pack | |
| tar -tzf *.tgz | grep -E "(bin/hogtyped|dist/.*\.js)" | |
| # Check Python package | |
| cd ../python | |
| python -m build | |
| unzip -l dist/*.whl | grep -E "(codegen\.py|__main__\.py)" | |
| # Success check - all tests must pass | |
| ci-success: | |
| name: CI Success | |
| runs-on: ubuntu-latest | |
| needs: [test-typescript, test-python, test-integration, test-examples, test-build] | |
| if: success() | |
| steps: | |
| - name: Success | |
| run: echo "All tests passed! 🎉" |