Skip to content

ci: add TypeScript and unit test jobs, fix pre-existing CI failures#158

Merged
pavelzeman merged 2 commits intomasterfrom
ci/migrate-to-github-actions
Mar 24, 2026
Merged

ci: add TypeScript and unit test jobs, fix pre-existing CI failures#158
pavelzeman merged 2 commits intomasterfrom
ci/migrate-to-github-actions

Conversation

@pavelzeman
Copy link
Copy Markdown
Contributor

@pavelzeman pavelzeman commented Mar 20, 2026

Summary

Builds on #161 (now merged). Adds the remaining two CI jobs — TypeScript and unit tests — along with fixes for pre-existing issues that prevented them from passing.

Jobs added

  • TypeScriptnpm run typescript (tsc --noEmit)
  • Unit Testsnpm test -- --coverage --passWithNoTests

Fixes

TypeScript errors (40+ failures): All from example/src/ referencing React Native dependencies (@react-navigation/stack, react-native-elements, etc.) that are only installed in example/node_modules, not at the root. Fix: simplify tsconfig.json exclude to just example instead of individual subdirectories.

Unit Tests "No tests found" (exit code 1): This repo has no JS/TS test files — all tests are Kotlin tests in test-runner/. Jest exits with code 1 when it finds zero matching test files. Fix: add --passWithNoTests to the Jest invocation.

Build dependency

build job now gates on all four check jobs: lint, typescript, unit-tests, kotlin-tests.

Notes

pavelzeman added a commit that referenced this pull request Mar 22, 2026
Bootstrap commit to enable CI on pull requests. The full migration
(tsconfig fix, passWithNoTests) follows in #158.

Co-authored-by: Claude <claude@anthropic.com>
pavelzeman added a commit that referenced this pull request Mar 22, 2026
Bootstrap workflow with the jobs that pass on current master: lint,
Kotlin tests, and build. TypeScript and unit test jobs are added in
#158 alongside the fixes they need (tsconfig exclude, passWithNoTests).

Co-authored-by: Claude <claude@anthropic.com>
@pavelzeman pavelzeman force-pushed the ci/migrate-to-github-actions branch 2 times, most recently from 83e3ca1 to ee0b815 Compare March 22, 2026 14:03
@pavelzeman pavelzeman changed the title Migrate CI from CircleCI to GitHub Actions ci: add TypeScript and unit test jobs, fix pre-existing CI failures Mar 22, 2026
@pavelzeman pavelzeman marked this pull request as ready for review March 22, 2026 14:04
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 22, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 295a5c63-8c77-4c9a-a773-d46c3980b13f

📥 Commits

Reviewing files that changed from the base of the PR and between ee0b815 and 88feb18.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • tsconfig.json
✅ Files skipped from review due to trivial changes (1)
  • tsconfig.json

📝 Walkthrough

Walkthrough

CI workflow updated: adds typescript and unit-tests jobs, and the build job now depends on lint, typescript, unit-tests, and kotlin-tests. TypeScript config now excludes the top-level example/ directory from compilation.

Changes

Cohort / File(s) Summary
CI Workflow
​.github/workflows/ci.yml
Added typescript and unit-tests jobs (Node 22, npm caching). build job dependencies extended to require lint, typescript, unit-tests, and kotlin-tests (previously only lint and kotlin-tests).
TypeScript Configuration
tsconfig.json
Replaced specific example/... exclusions with a single top-level example entry in exclude, broadening the excluded paths from TypeScript compilation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: adding TypeScript and unit test CI jobs while fixing pre-existing failures that prevented them from passing.
Description check ✅ Passed The description is well-related to the changeset, providing clear context about the CI jobs added, specific fixes for TypeScript and Jest failures, and the rationale for each change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/migrate-to-github-actions

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
.github/workflows/ci.yml (1)

41-51: Consider uploading coverage artifacts for visibility.

The job generates coverage output but doesn't preserve it. Uploading coverage reports as workflow artifacts (or to a service like Codecov) would provide better visibility into test coverage over time.

♻️ Optional: Upload coverage artifact
       - run: npm ci
       - run: npm test -- --coverage --passWithNoTests
+      - uses: actions/upload-artifact@v4
+        with:
+          name: coverage-report
+          path: coverage/
+          retention-days: 14
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml around lines 41 - 51, The unit-tests job currently
runs "npm test -- --coverage --passWithNoTests" but doesn't persist the coverage
output; add an upload step to the "unit-tests" job (after the test step) using
the GitHub Actions upload-artifact action to store coverage files (e.g., upload
"coverage" directory or "coverage/lcov.info") with a clear artifact name such as
"coverage-report"; alternatively, add the Codecov action
(codecov/codecov-action) after the test step to submit coverage to Codecov if
you prefer external reporting.
tsconfig.json (1)

37-39: Redundant exclude entries after adding "example".

Now that "example" is excluded entirely, the more specific patterns "example/detox/**/*" and "example/node_modules" are redundant since TypeScript will already skip the entire example/ directory. Consider removing them for clarity.

♻️ Optional cleanup
   "exclude": [
     "lib",
     "node_modules",
     "build",
     "babel.config.js",
     "metro.config.js",
     "jest.config.js",
-    "example/detox/**/*",
-    "example/node_modules",
     "example"
   ]
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tsconfig.json` around lines 37 - 39, Remove the redundant exclude patterns
"example/detox/**/*" and "example/node_modules" from the tsconfig.json exclude
array since the broader "example" entry already excludes the entire directory;
locate the exclude array containing "example", "example/detox/**/*", and
"example/node_modules" and delete the two specific patterns so only "example"
remains.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 41-51: The unit-tests job currently runs "npm test -- --coverage
--passWithNoTests" but doesn't persist the coverage output; add an upload step
to the "unit-tests" job (after the test step) using the GitHub Actions
upload-artifact action to store coverage files (e.g., upload "coverage"
directory or "coverage/lcov.info") with a clear artifact name such as
"coverage-report"; alternatively, add the Codecov action
(codecov/codecov-action) after the test step to submit coverage to Codecov if
you prefer external reporting.

In `@tsconfig.json`:
- Around line 37-39: Remove the redundant exclude patterns "example/detox/**/*"
and "example/node_modules" from the tsconfig.json exclude array since the
broader "example" entry already excludes the entire directory; locate the
exclude array containing "example", "example/detox/**/*", and
"example/node_modules" and delete the two specific patterns so only "example"
remains.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e0d67fa1-5cbf-407d-a9a6-e7caaddb0986

📥 Commits

Reviewing files that changed from the base of the PR and between 1732edd and ee0b815.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • tsconfig.json

Copy link
Copy Markdown
Contributor

@esarafianou esarafianou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there are zero JS/TS test files in this repo, Jest will always exit immediately having done nothing. This burns ~60-90s of CI time on every PR and push to master for a no-op.

I'd recommend adding this job when we introduce JS/TS test files so CI time isn't wasted until then. @pavelzeman did you intentionally include it now so the pipeline is ready when tests are added? That's a valid approach too, it's mainly the CI cost that steers me towards skipping it for now.

pavelzeman added a commit that referenced this pull request Mar 23, 2026
* ci: add GitHub Actions workflow (lint, Kotlin tests, build)

Bootstrap workflow with the jobs that pass on current master: lint,
Kotlin tests, and build. TypeScript and unit test jobs are added in
#158 alongside the fixes they need (tsconfig exclude, passWithNoTests).

Co-authored-by: Claude <claude@anthropic.com>

* ci: pin actions to SHAs, add explicit permissions

Address CodeRabbit feedback:
- Pin actions/checkout, actions/setup-node, actions/setup-java to
  full commit SHAs to reduce supply-chain risk
- Add workflow-level permissions: contents: read for least privilege

Co-authored-by: Claude <claude@anthropic.com>

* ci: update Node.js from 18 (EOL) to 22 LTS

Node 18 reached end-of-life. Node 20 reaches EOL in May 2026.
Use Node 22 LTS for longer support runway.

Co-authored-by: Claude <claude@anthropic.com>

---------

Co-authored-by: Claude <claude@anthropic.com>
Builds on #161 (which added the base CI workflow with lint, Kotlin tests,
and build). This commit adds the remaining two jobs:

- TypeScript — npm run typescript (tsc --noEmit)
- Unit Tests — npm test -- --coverage --passWithNoTests

Fixes:
- TypeScript: exclude example/ from tsconfig.json (references
  React Navigation deps only in example/node_modules)
- Unit Tests: --passWithNoTests since repo has no JS/TS test files
  (all tests are Kotlin in test-runner/)

Build job now depends on all four check jobs.

Co-authored-by: Claude <claude@anthropic.com>
@pavelzeman pavelzeman force-pushed the ci/migrate-to-github-actions branch from ee0b815 to 88feb18 Compare March 23, 2026 21:05
There are zero JS/TS test files in this repo, so the Jest job was
burning ~60-90s of CI time per run for nothing. Removed per reviewer
feedback — can re-add when JS/TS tests are introduced.

Co-authored-by: Claude <claude@anthropic.com>
@pavelzeman
Copy link
Copy Markdown
Contributor Author

Good call @esarafianou — you're right, there are zero JS/TS test files in this repo so the Jest job was a pure no-op burning CI time. Removed it in c4d4515. We can add it back when JS/TS tests are actually introduced.

Also cleaned up the redundant tsconfig.json exclude entries per CodeRabbit's nitpick.

@pavelzeman
Copy link
Copy Markdown
Contributor Author

CI Jobs Summary

For clarity on what each job actually does:

  • Lint — ESLint static analysis
  • TypeScripttsc --noEmit type-checking (not tests — validates the source compiles cleanly; this caught 40+ real type errors from example/ leaking into the check)
  • Kotlin Tests — the only actual test suite in this repo (5 tests: OkHttp interceptor behavior via MockWebServer)
  • Buildnpm run prepare (compiles the publishable package)

No JS/TS test files exist in this repo, so there's no Jest job. Can be added when JS/TS tests are introduced.

@pavelzeman pavelzeman merged commit 7305814 into master Mar 24, 2026
4 checks passed
@pavelzeman pavelzeman deleted the ci/migrate-to-github-actions branch March 24, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants