Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/mobile-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ on:
paths:
- 'products/mobile/**'
- '!products/mobile/**/*.md'
- 'products/signals/frontend/generated/**'
- '.github/workflows/mobile-ci.yml'
# Master pushes refresh the pnpm store cache that PR runs restore.
push:
branches: [master]
paths:
- 'products/mobile/**'
- '!products/mobile/**/*.md'
- 'products/signals/frontend/generated/**'
- '.github/workflows/mobile-ci.yml'

concurrency:
Expand All @@ -40,7 +42,9 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
sparse-checkout: products/mobile
sparse-checkout: |
products/mobile
products/signals/frontend/generated/api.schemas.ts
sparse-checkout-cone-mode: false

# Reads packageManager from the app's package.json, not the repo root's,
Expand Down
1 change: 1 addition & 0 deletions products/mobile/.npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node-linker=hoisted
min-release-age=7
3 changes: 2 additions & 1 deletion products/mobile/docs/CI.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Two GitHub Actions workflows cover the app. Both work inside `products/mobile` a

## Mobile CI

`.github/workflows/mobile-ci.yml` runs on pull requests and on pushes to `master` that change `products/mobile/**` or the workflow file.
`.github/workflows/mobile-ci.yml` runs on pull requests and on pushes to `master` that change `products/mobile/**`, the generated Signals API types, or the workflow file.
Markdown changes alone do not start it.

One job runs these steps, the same commands you run locally:
Expand All @@ -20,6 +20,7 @@ Write `pnpm test --ci`, not `pnpm test -- --ci`. pnpm forwards the `--`, and Jes

Details:

- The sparse checkout includes the generated Signals API schema imported by the app.
- pnpm comes from `packageManager` in `products/mobile/package.json`, not from the repo root.
- Node comes from `products/mobile/.node-version`. Keep it equal to the repo's `.nvmrc` and to `node` in `eas.json`.
- The pnpm store cache is keyed on `products/mobile/pnpm-lock.yaml`. Pull requests only restore it. Pushes to `master` save it.
Expand Down
1 change: 1 addition & 0 deletions products/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"@react-native/metro-config": "0.86.3",
"@testing-library/react-native": "^13.3.3",
"@types/jest": "^29.5.14",
"@types/markdown-it": "14.2.0",
"@types/react": "~19.2.4",
"jest": "^29.7.0",
"jest-expo": "~57.0.2",
Expand Down
21 changes: 21 additions & 0 deletions products/mobile/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion products/mobile/src/features/chat/ChatMarkdown.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ jest.mock('./MermaidDiagram', () => ({ MermaidDiagram: jest.fn(() => null) }))
const summary = getInsightSummary as jest.MockedFunction<typeof getInsightSummary>
function view(text: string): ReturnType<typeof render> {
return render(
<QueryClientProvider client={new QueryClient({ defaultOptions: { queries: { retry: false } } })}>
<QueryClientProvider
client={new QueryClient({ defaultOptions: { queries: { retry: false, gcTime: Infinity } } })}
>
<ChatMarkdown text={text} />
</QueryClientProvider>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const BASE: MetricView = {
}

function renderCard(metric: MetricView): void {
const client = new QueryClient()
const client = new QueryClient({ defaultOptions: { queries: { gcTime: Infinity } } })
const tree: ReactElement = (
<QueryClientProvider client={client}>
<ObservationCard metric={metric} reportId="report-1" accent="alert" />
Expand Down
Loading