Skip to content

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rn-ci-matrix

CI

GitHub Actions matrix templates for React Native CI without cloud device farms.

This repository ships a composite action plus an example workflow so you can run lint and unit-test placeholders across multiple Node.js versions. It is intentionally credential-free: no EAS, no device-farm tokens, and no signing secrets.

What you get

Piece Purpose
action.yml Reusable composite action: setup Node → install → lint → test
.github/workflows/example.yml Copy-paste workflow template with a Node matrix
.github/workflows/example-yarn.yml Yarn variant (cache: yarn, frozen lockfile install)
.github/workflows/ci.yml Self-check: validates action.yml and smoke-runs the action

Quick start (consumer app)

  1. In your React Native app, add a workflow (or copy example.yml):
name: RN CI
on:
  push:
  pull_request:

jobs:
  lint-test:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        node-version: ['18', '20', '22', '24']
    steps:
      - uses: actions/checkout@v4
      - name: Lint & test matrix cell
        uses: daniel-chen-j/rn-ci-matrix@main
        with:
          node-version: ${{ matrix.node-version }}
          working-directory: '.'
  1. Ensure package.json defines lint and test scripts (Jest, ESLint, etc.).
  2. Push — each matrix cell installs deps and runs lint/test on that Node version.

Inputs

Input Default Description
node-version (required) Node.js version for the matrix cell
working-directory . App root with package.json
run-lint true Toggle lint step
run-test true Toggle test step
lint-command npm run lint Lint command override
test-command npm test -- --ci --passWithNoTests Test command override
install-command npm ci Install command override
cache npm actions/setup-node cache (npm, yarn, pnpm, or none)
cache-dependency-path (auto) Lockfile path(s) for the cache key; defaults from cache

Local smoke scripts

This repo includes tiny placeholders used by the self-hosted CI smoke job:

npm run validate:action
npm run lint
npm test

Design notes

  • Default branch is main — pin consumers to @main (or a release tag) rather than a long-lived develop branch.
  • Matrix over Node versions (18, 20, 22, and 24), not over emulators or physical devices.
  • No EAS / Expo credentials — keep mobile cloud build pipelines separate.
  • Job summaries — each matrix cell appends Node/cache/lint/test toggles to $GITHUB_STEP_SUMMARY for faster Actions debugging.
  • Pair this with your own build jobs later if you need Android/iOS binaries; keep unit CI cheap and secret-free.

Troubleshooting

Symptom Likely cause Fix
Cache miss every run Wrong lockfile path for your package manager Set cache to npm/yarn/pnpm and/or pass cache-dependency-path explicitly
npm ci fails Repo uses Yarn/pnpm (no package-lock.json) Override install-command (e.g. yarn install --frozen-lockfile) and matching lint/test commands
Validation step fails on package.json working-directory points at the wrong folder Point it at the app root that contains package.json
Matrix job green but app not linted Placeholder scripts or toggles disabled Ensure app package.json defines real lint/test scripts; keep run-lint/run-test as true
Want fewer Node versions Default matrix includes 18–24 Trim matrix.node-version in your workflow copy

License

MIT

About

GitHub Actions matrix templates for React Native CI without cloud device farms.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages