Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install test refactored #5085

Merged
merged 58 commits into from
Nov 10, 2022
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
86c8ebd
Refactored the install test
kraenhansen Nov 6, 2022
ed99191
Install CLI deps
kraenhansen Nov 6, 2022
be56388
Test android
kraenhansen Nov 6, 2022
d8e2342
Improved Slack message
kraenhansen Nov 6, 2022
bc95d29
Installing and skipping ios on android
kraenhansen Nov 6, 2022
b134ad0
Update install-test-react-native.yml
kraenhansen Nov 6, 2022
834dae5
Update cli.ts
kraenhansen Nov 6, 2022
5c1feb3
Update install-test-react-native.yml
kraenhansen Nov 6, 2022
d847833
Update install-test-react-native.yml
kraenhansen Nov 6, 2022
1243b13
Update install-test-react-native.yml
kraenhansen Nov 6, 2022
5f6b5f8
Update install-test-react-native.yml
kraenhansen Nov 6, 2022
1b9bbe2
Update install-test-react-native.yml
kraenhansen Nov 6, 2022
073fe35
Update install-test-react-native.yml
kraenhansen Nov 6, 2022
fa9ce37
Update install-test-react-native.yml
kraenhansen Nov 6, 2022
d89498e
Update install-test-react-native.yml
kraenhansen Nov 6, 2022
95becd2
Applying a Podfile patch to use ccache
kraenhansen Nov 6, 2022
1811545
Configuring ccache
kraenhansen Nov 6, 2022
2875e12
Make ccache key more specific to avoid cross contamination
kraenhansen Nov 6, 2022
805d3fb
Printing timeout in error
kraenhansen Nov 6, 2022
2bcfde4
Announce on Slack only once pr run
kraenhansen Nov 6, 2022
a5dde0f
Tried downgrading Xcode
kraenhansen Nov 6, 2022
b1fbf72
Fixed syntax error
kraenhansen Nov 6, 2022
71f3f48
Update install-test-react-native.yml
kraenhansen Nov 6, 2022
ee360d6
Try failing when test fails
kraenhansen Nov 7, 2022
71e94ac
Update install-test-react-native.yml
kraenhansen Nov 7, 2022
0fd6af4
Attempt to propagate result of all matrix jobs
kraenhansen Nov 7, 2022
a3ea580
Cache CocoaPods
kraenhansen Nov 7, 2022
87dc3b8
Add --active-arch-only
kraenhansen Nov 7, 2022
35e6882
Re-arranged the matrix props
kraenhansen Nov 7, 2022
4cae4e2
Run earlier
kraenhansen Nov 7, 2022
5b2736b
Adding an option run tests with JSC
kraenhansen Nov 7, 2022
49cd30c
Adding engine to workflow matrix
kraenhansen Nov 8, 2022
838ac03
Update install-test-react-native.yml
kraenhansen Nov 7, 2022
53c8cc8
Cache CocoaPods only when testing on ios
kraenhansen Nov 8, 2022
aaeac15
Update install-tests/react-native/cli.ts
kraenhansen Nov 8, 2022
a89a814
Apply patches only if files exists
kraenhansen Nov 8, 2022
df36fd8
Upload result artifacts
kraenhansen Nov 8, 2022
5e9b95b
Moved App.js into patches
kraenhansen Nov 8, 2022
7e68e0b
Writing a local.properties for Android
kraenhansen Nov 8, 2022
32df771
Upload result from install-tests/react-native
kraenhansen Nov 8, 2022
df6999e
Use CLI to generate Slack payload
kraenhansen Nov 8, 2022
e63554a
Update install-test-react-native.yml
kraenhansen Nov 8, 2022
567acaf
Assuming location of results
kraenhansen Nov 8, 2022
9a1cfab
Renamed command
kraenhansen Nov 8, 2022
6258531
Resolving and printing output path
kraenhansen Nov 8, 2022
f6a126f
Updated upload path
kraenhansen Nov 8, 2022
bcc5586
Update install-test-react-native.yml
kraenhansen Nov 9, 2022
dbcf0c8
Corrected the file path when loading result files
kraenhansen Nov 9, 2022
3459c55
Update install-test-react-native.yml
kraenhansen Nov 9, 2022
2d2665e
Locating result.json recursively
kraenhansen Nov 9, 2022
620750a
Update install-test-react-native.yml
kraenhansen Nov 9, 2022
def5a39
Update install-test-react-native.yml
kraenhansen Nov 9, 2022
676d6ef
Reverted the custom slack message builder
kraenhansen Nov 9, 2022
32084a7
Adding a timeout the the emulator
kraenhansen Nov 10, 2022
5903eb0
Rearranged options
kraenhansen Nov 10, 2022
b1e4ee8
Throw instead of calling process.exit
kraenhansen Nov 10, 2022
91eadbc
Remove old script from package.json
kraenhansen Nov 10, 2022
e6804a1
Update install-tests/react-native/cli.ts
kraenhansen Nov 10, 2022
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
136 changes: 103 additions & 33 deletions .github/workflows/install-test-react-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,63 +6,133 @@ on:
paths:
- install-tests/react-native/**
- .github/workflows/install-test-react-native.yml
# Every day at 9:00 CET
# Every monday at 7:00 CET
schedule:
- cron: "0 8 * * *"
- cron: "0 6 * * 1"
# You can also activate this workflow manually from the Actions tab
workflow_dispatch:
inputs:
react-native-version:
description: The version of React Native to install
required: true
default: next
realm-version:
description: The version of Realm to install
required: true
default: latest

defaults:
run:
working-directory: install-tests/react-native

jobs:
install:
name: Installing Realm → React Native (using Xcode v${{matrix.xcode}}, node v${{ matrix.node }}, npm v${{ matrix.npm }})
runs-on: macos-11
runs-on: macos-12
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
# See https://github.com/actions/virtual-environments/blob/main/images/macos/macos-11-Readme.md#xcode
platform:
- ios
- android
realm-version:
# - v10 # Enable if we feel the need
- latest
react-native-version:
- latest
- next
# - nightly # Enable if it's not too noizy
new-architecture:
- true
- false
engine:
- jsc
- hermes
# See https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md#xcode
xcode:
# - 14.0.1
- 13.1
npm:
- 7
node:
- 14
- 16
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Install npm v7
run: npm install -g npm@8

- name: ccache
uses: hendrikmuhs/ccache-action@v1
uses: hendrikmuhs/ccache-action@v1.2
with:
key: install-test
key: install-test-${{ matrix.platform }}-r@${{ matrix.realm-version }}-rn@${{ matrix.react-native-version }}-${{ matrix.new-architecture && 'new' || 'old' }}-arch
max-size: '2.0G'
- name: Prepend ccache executables to the PATH
run: echo PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" >> $GITHUB_ENV
- name: Install React Native & Realm
run: ./install.sh ${{ github.event.inputs.react-native-version }} ${{ github.event.inputs.realm-version }}
run: echo "/usr/local/opt/ccache/libexec" >> $GITHUB_PATH
- name: Configure ccache
run: ccache --set-config="compiler_check=content"

# TODO: Remove if this becomes unneeded in the future
- name: Invoke the simulator (making subsequent "open -a Simulator" calls work)
if: ${{ matrix.platform == 'ios' }}
run: open -a ${{ env.DEVELOPER_DIR }}/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator

- name: Install dependencies of the CLI
run: npm ci

- name: Initialize app
# Using "--skip-bundle-install" to let the setup-ruby action install the bundle
# Using "--skip-pod-install" to ensure it happens after setup-ruby has executed
run: npm run init -- --skip-bundle-install --skip-pod-install --realm-version ${{ matrix.realm-version }} --react-native-version ${{ matrix.react-native-version }} --engine ${{ matrix.engine }}

- name: CocoaPod cache
takameyer marked this conversation as resolved.
Show resolved Hide resolved
if: ${{ matrix.platform == 'ios' }}
uses: actions/cache@v3
with:
path: '**/Pods'
key: cocoa-pods-${{ matrix.platform }}-r@${{ matrix.realm-version }}-rn@${{ matrix.react-native-version }}-${{ matrix.new-architecture && 'new' || 'old' }}-arch

- uses: ruby/setup-ruby@v1
if: ${{ matrix.platform == 'ios' }}
with:
bundler-cache: true
working-directory: install-tests/react-native/app

- if: ${{ matrix.platform == 'ios' }}
run: pod install
working-directory: install-tests/react-native/app/ios

- uses: actions/setup-java@v3
if: ${{ matrix.platform == 'android' }}
with:
distribution: 'zulu'
java-version: '11'

- name: Run test (iOS)
run: ./run-ios.sh
# - name: Run test (Android)
# uses: reactivecircus/android-emulator-runner@v2
# with:
# api-level: 29
# target: google_apis
# script: ./run-android.sh
if: ${{ matrix.platform == 'ios' }}
run: npm test -- --platform ios

- name: Run test (Android)
if: ${{ matrix.platform == 'android' }}
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
target: google_apis
script: npm test -- --platform android
working-directory: install-tests/react-native

announce:
needs: install
runs-on: ubuntu-latest
if: always()
steps:
- name: Post result to Slack
uses: slackapi/[email protected]
with:
# For posting a rich message using Block Kit
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Install test *${{ needs.install.result }}*\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
takameyer marked this conversation as resolved.
Show resolved Hide resolved
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_TEST_WEBHOOK }}
takameyer marked this conversation as resolved.
Show resolved Hide resolved
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
2 changes: 1 addition & 1 deletion install-tests/react-native/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { useEffect } from "react";
import Realm from "realm";

const CALLBACK_HOST = "http://localhost:3000";
const DELAY = 5000;
const DELAY = 1000;
const schema = [{ name: "Person", properties: { name: "string" } }];
const App = () => {
useEffect(() => {
Expand Down
Loading