Merge pull request #2 from Factory-AI/fix-tsconfig-bump-version #11
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: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Type check | |
| run: bun run typecheck | |
| - name: Build for npm | |
| run: npm run build:js | |
| - name: Test npm CLI | |
| run: node dist/cli.js --help | |
| - name: Test npm pack and install | |
| run: | | |
| npm pack | |
| npm install -g factory-nanobanana-*.tgz | |
| nanobanana --help | |
| nanobanana tips generate | |
| - name: Build standalone binary | |
| run: bun build cli.ts --compile --outfile nanobanana | |
| - name: Test standalone CLI | |
| run: ./nanobanana --help | |
| unit-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Run unit tests | |
| run: bun test tests/unit.test.ts | |
| e2e-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Run e2e tests | |
| run: bun test tests/e2e.test.ts | |
| integration-tests: | |
| runs-on: ubuntu-latest | |
| # Only run for authorized contributors | |
| if: github.actor == 'enoreyes' || github.actor == 'factory-droid[bot]' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Run integration tests | |
| env: | |
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | |
| run: bun test tests/integration.test.ts --timeout 180000 | |
| version-check: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check version bump | |
| run: | | |
| BASE_VERSION=$(git show origin/main:package.json | jq -r '.version') | |
| PR_VERSION=$(jq -r '.version' package.json) | |
| if [ "$BASE_VERSION" = "$PR_VERSION" ]; then | |
| echo "::warning::Version not bumped. Current: $BASE_VERSION" | |
| echo "Consider bumping the version in package.json if this PR includes user-facing changes." | |
| else | |
| echo "Version bumped: $BASE_VERSION -> $PR_VERSION" | |
| fi |