Skip to content

Commit

Permalink
fix: test app is now created by the cli and is no longer packaged
Browse files Browse the repository at this point in the history
  • Loading branch information
acostalima committed Jan 6, 2021
1 parent 7594d3b commit 853c795
Show file tree
Hide file tree
Showing 64 changed files with 706 additions and 6,707 deletions.
146 changes: 71 additions & 75 deletions .github/workflows/node-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,63 +7,63 @@ on:
branches: [master]

jobs:
android:
runs-on: macos-latest
env:
CI: 1
strategy:
matrix:
android-api: [28]
android-target: [default]
node-version: [12, 14]
name: "Matrix: Node v${{ matrix.node-version }}; Android API ${{ matrix.android-api }}"
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Cache node_modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-npm-

- name: Install node_modules
run: |
npm ci --prefer-offline --no-audit
- name: Lint
run: |
npm run lint
- name: Cache Android build
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle-

- name: Run Android tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.android-api }}
target: ${{ matrix.android-target }}
arch: x86_64
profile: pixel
script: |
npm t -- android
- name: Submit coverage
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
# android:
# runs-on: macos-latest
# env:
# CI: 1
# strategy:
# matrix:
# android-api: [28]
# android-target: [default]
# node-version: [12, 14]
# name: "Matrix: Node v${{ matrix.node-version }}; Android API ${{ matrix.android-api }}"
# steps:
# - name: Checkout code
# uses: actions/checkout@v2

# - name: Set up Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v1
# with:
# node-version: ${{ matrix.node-version }}

# - name: Cache node_modules
# uses: actions/cache@v2
# with:
# path: ~/.npm
# key: ${{ runner.os }}-npm-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: ${{ runner.os }}-npm-

# - name: Install node_modules
# run: |
# npm ci --prefer-offline --no-audit

# - name: Lint
# run: |
# npm run lint

# # - name: Cache Android build
# # uses: actions/cache@v2
# # with:
# # path: |
# # ~/.gradle/caches
# # ~/.gradle/wrapper
# # key: ${{ runner.os }}-gradle-${{ hashFiles('$HOME/.npm/rn-test-app/android/**/*.gradle*') }}-${{ hashFiles('$HOME/.npm/rn-test-app/android/gradle/wrapper/gradle-wrapper.properties') }}
# # restore-keys: ${{ runner.os }}-gradle-

# - name: Run Android tests
# uses: reactivecircus/android-emulator-runner@v2
# with:
# api-level: ${{ matrix.android-api }}
# target: ${{ matrix.android-target }}
# arch: x86_64
# profile: pixel
# script: |
# npm t -- android

# - name: Submit coverage
# uses: codecov/codecov-action@v1
# with:
# token: ${{ secrets.CODECOV_TOKEN }}

ios:
runs-on: macos-latest
Expand Down Expand Up @@ -98,18 +98,14 @@ jobs:
run: |
npm run lint
- name: Cache pods and repositories
uses: actions/cache@v2
with:
path: |
~/Library/Caches/CocoaPods
~/.cocoapods
key: ${{ runner.os }}-cocoapods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: ${{ runner.os }}-cocoapods-

- name: Install Pods
run: |
npm run pods
# - name: Cache pods and repositories
# uses: actions/cache@v2
# with:
# path: |
# ~/Library/Caches/CocoaPods
# ~/.cocoapods
# key: ${{ runner.os }}-cocoapods-${{ hashFiles('$HOME/.npm/rn-test-app/ios/Podfile.lock') }}
# restore-keys: ${{ runner.os }}-cocoapods-

# - name: Set up ${{ matrix.apple-runtime }} runtime
# run: |
Expand All @@ -129,12 +125,12 @@ jobs:
echo "IOS_SIMULATOR=$SIMULATOR_ID" >> $GITHUB_ENV
xcrun simctl boot $SIMULATOR_ID &
- name: Cache iOS build
uses: actions/cache@v2
with:
path: ~/Library/Developer/Xcode/DerivedData/Test-*
key: ${{ runner.os }}-xcodebuild-${{ hashFiles('ios/Test*/**') }}
restore-keys: ${{ runner.os }}-xcodebuild-
# - name: Cache iOS build
# uses: actions/cache@v2
# with:
# path: ~/Library/Developer/Xcode/DerivedData/Test-*
# key: ${{ runner.os }}-xcodebuild-${{ hashFiles('$HOME/.npm/rn-test-app/ios/Test*/**') }}
# restore-keys: ${{ runner.os }}-xcodebuild-

- name: Run iOS tests
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,4 @@ ios/Pods/

# Jest
coverage/

1 change: 0 additions & 1 deletion .watchmanconfig

This file was deleted.

5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ $ npm install -D react-native-test-runner
- No coverage.
- Only iOS simulators and Android emulators are supported.
- JavaScriptCore (JSC) engine only on both Android and iOS.

- No TypeScript (TS) support.
- Not yet possible to run tests against native modules.
## Usage

```
Expand All @@ -38,6 +39,8 @@ Options
--emulator, -e Android emulator to run the test suites on.
--metroPort, -p Port on which Metro's server should listen to. Default: 8081.
--cwd Current directory. Default: process.cwd().
--rn React Native version to test against. Default: 0.63.4.
--app Absolute path to the test app. Default: ~/.npm/rn-test-app.
Examples
# Run tests on iPhone 11 simulator with iOS version 14.1
Expand Down
Loading

0 comments on commit 853c795

Please sign in to comment.