Skip to content

Commit d89a744

Browse files
committed
Refactor to reusable workflows
1 parent 14eeddc commit d89a744

File tree

7 files changed

+346
-268
lines changed

7 files changed

+346
-268
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: prepare-hermes-v1-app
2+
description: Prepares a React Native app with Hermes V1 enabled
3+
inputs:
4+
retry-count:
5+
description: 'Number of times to retry the yarn install on failure'
6+
runs:
7+
using: composite
8+
steps:
9+
- name: Create new app
10+
shell: bash
11+
run: |
12+
cd /tmp
13+
npx @react-native-community/cli init RNApp --skip-install --version nightly
14+
15+
- name: Apply patch if specified
16+
shell: bash
17+
run: |
18+
if [ -f "$GITHUB_WORKSPACE/patches/hermes-v1.patch" ]; then
19+
echo "Applying patch: hermes-v1.patch"
20+
cd /tmp/RNApp
21+
node "$GITHUB_WORKSPACE/scripts/apply-patch.js" "$GITHUB_WORKSPACE/patches/hermes-v1.patch"
22+
echo "✅ Patch applied successfully"
23+
else
24+
echo "⚠️ Warning: Patch file not found: patches/hermes-v1.patch"
25+
exit 1
26+
fi
27+
28+
- name: Install app dependencies with retry
29+
uses: nick-fields/retry@v3
30+
with:
31+
timeout_minutes: 10
32+
max_attempts: ${{ inputs.retry-count }}
33+
retry_wait_seconds: 15
34+
shell: bash
35+
command: |
36+
cd /tmp/RNApp
37+
yarn install
38+
on_retry_command: |
39+
echo "Cleaning up for yarn retry..."
40+
cd /tmp/RNApp
41+
rm -rf node_modules yarn.lock || true
42+
yarn cache clean || true
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: setup-maestro
2+
description: Sets up the Maestro testing environment
3+
runs:
4+
using: composite
5+
steps:
6+
- name: Setup Java
7+
uses: actions/setup-java@v2
8+
with:
9+
java-version: '17'
10+
distribution: 'zulu'
11+
12+
- name: Install Maestro
13+
shell: bash
14+
run: export MAESTRO_VERSION=1.40.0; curl -Ls "https://get.maestro.mobile.dev" | bash
15+
16+
- name: Install Maestro dependencies
17+
if: runner.os == 'macOS'
18+
shell: bash
19+
run: |
20+
brew tap facebook/fb
21+
brew install facebook/fb/idb-companion

.github/actions/test-hermes-v1/action.yml

Lines changed: 0 additions & 206 deletions
This file was deleted.

.github/workflows/check-nightly.yml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,35 @@ jobs:
4545
firebase_app_email: ${{ secrets.FIREBASE_APP_EMAIL }}
4646
firebase_app_pass: ${{ secrets.FIREBASE_APP_PASS }}
4747
firebase_app_projectname: ${{ secrets.FIREBASE_APP_PROJECTNAME }}
48-
firebase_app_apikey: ${{ secrets.FIREBASE_APP_APIKEY }}
48+
firebase_app_apikey: ${{ secrets.FIREBASE_APP_APIKEY }}
49+
50+
test-hermes-v1-ios:
51+
uses: ./.github/workflows/test-hermes-v1-ios.yml
52+
needs: check-nightly
53+
54+
test-hermes-v1-android:
55+
uses: ./.github/workflows/test-hermes-v1-android.yml
56+
needs: check-nightly
57+
58+
collect-results:
59+
runs-on: ubuntu-latest
60+
needs: [test-libraries, test-hermes-v1-ios, test-hermes-v1-android]
61+
steps:
62+
- name: Checkout
63+
uses: actions/checkout@v4
64+
- name: Restore outcomes
65+
uses: actions/download-artifact@v4
66+
with:
67+
pattern: '*-outcome'
68+
path: /tmp
69+
- name: Collect failures
70+
uses: actions/github-script@v6
71+
env:
72+
FIREBASE_APP_EMAIL: ${{ secrets.firebase_app_email }}
73+
FIREBASE_APP_PASS: ${{ secrets.firebase_app_pass }}
74+
FIREBASE_APP_APIKEY: ${{ secrets.firebase_app_apikey }}
75+
FIREBASE_APP_PROJECTNAME: ${{ secrets.firebase_app_projectname }}
76+
with:
77+
script: |
78+
const {collectResults} = require('./.github/workflow-scripts/collectNightlyOutcomes.js');
79+
await collectResults('${{secrets.discord_webhook_url}}');

0 commit comments

Comments
 (0)