feat(mobile): persist state + serve a cached fleet on launch #55
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-ts | |
| # TypeScript / JavaScript CI for the CumulusVPN monorepo. | |
| # Covers the three root Yarn workspaces (core-ts, web, desktop) plus the two | |
| # standalone packages that are intentionally NOT root workspaces: the mobile | |
| # React Native app and the deploy tooling (each carries its own yarn.lock). | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'clients/**' | |
| - 'deploy/**' | |
| - 'package.json' | |
| - 'yarn.lock' | |
| - 'tsconfig*.json' | |
| - '.prettierrc' | |
| - '.prettierignore' | |
| - '.yarnrc.yml' | |
| - '.github/workflows/ci-ts.yml' | |
| pull_request: | |
| paths: | |
| - 'clients/**' | |
| - 'deploy/**' | |
| - 'package.json' | |
| - 'yarn.lock' | |
| - 'tsconfig*.json' | |
| - '.prettierrc' | |
| - '.prettierignore' | |
| - '.yarnrc.yml' | |
| - '.github/workflows/ci-ts.yml' | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-ts-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| # Root workspaces share one immutable install; the matrix fans out per package. | |
| workspaces: | |
| name: workspace (${{ matrix.name }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: core-ts | |
| pkg: '@cumulusvpn/core' | |
| - name: web | |
| pkg: '@cumulusvpn/web' | |
| - name: desktop | |
| pkg: '@cumulusvpn/desktop' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup Node | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: 22 | |
| # Corepack must be enabled BEFORE any `yarn` call: the packageManager | |
| # field pins yarn@4, and setup-node's built-in `cache: yarn` would invoke | |
| # the runner's global Yarn 1 and fail. So no setup-node cache here. | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Install (immutable) | |
| run: yarn install --immutable | |
| # web and desktop import @cumulusvpn/core via its built dist (types + js), | |
| # so build it before the per-package checks run on a clean checkout. | |
| - name: Build @cumulusvpn/core | |
| run: yarn workspace @cumulusvpn/core run build | |
| - name: format:check | |
| run: yarn workspace ${{ matrix.pkg }} run format:check | |
| - name: lint | |
| run: yarn workspace ${{ matrix.pkg }} run lint | |
| - name: typecheck | |
| run: yarn workspace ${{ matrix.pkg }} run typecheck | |
| - name: test | |
| run: yarn workspace ${{ matrix.pkg }} run test | |
| - name: build | |
| run: yarn workspace ${{ matrix.pkg }} run build | |
| # React Native app — standalone install, no bundler build in CI (store builds | |
| # happen on native runners); we gate on format, lint, types and unit tests. | |
| mobile: | |
| name: mobile (react-native) | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: clients/mobile | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup Node | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: 22 | |
| - name: Enable Corepack | |
| run: corepack enable | |
| # The mobile app consumes @cumulusvpn/core via `file:../core-ts`, and its | |
| # jest moduleNameMapper resolves it to dist/index.js. dist/ is a build | |
| # output (gitignored), so it must be built BEFORE the mobile install copies | |
| # the package — otherwise `yarn test` fails on a clean checkout. | |
| - name: Build shared core | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| yarn install --immutable | |
| yarn workspace @cumulusvpn/core run build | |
| # @cumulusvpn/core is a file:../core-ts dep whose content-hash drifts as | |
| # core-ts changes; CI defaults to immutable installs, so opt out here. | |
| - name: Install | |
| run: yarn install --no-immutable | |
| - name: format:check | |
| run: yarn format:check | |
| - name: lint | |
| run: yarn lint | |
| - name: typecheck | |
| run: yarn tsc --noEmit | |
| - name: test | |
| run: yarn test | |
| # Deploy tooling — standalone install; pure Node (.mjs), so no typecheck/build. | |
| deploy: | |
| name: deploy (tooling) | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: deploy | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup Node | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: 22 | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Install | |
| run: yarn install | |
| - name: lint | |
| run: yarn lint | |
| - name: format:check | |
| run: yarn format:check | |
| - name: test | |
| run: yarn test |