Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
156 changes: 156 additions & 0 deletions .github/workflows/expo-beta-road-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
name: Expo beta road test
run-name: Expo beta road test

on:
schedule:
- cron: '0 6 */2 * *'
workflow_dispatch:

permissions:
actions: read
contents: read

jobs:
prepare:
name: Detect Expo beta to test
runs-on: ubuntu-latest
outputs:
latest_version: ${{ steps.finalize.outputs.latest_version }}
should_test: ${{ steps.finalize.outputs.should_test }}
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6

- name: Detect latest Expo beta
id: detect
run: node --experimental-strip-types --no-warnings ./scripts/check-expo-beta.ts --github-output "$GITHUB_OUTPUT" --github-step-summary "$GITHUB_STEP_SUMMARY"

- name: Check whether this Expo beta was already tested
id: tested
if: steps.detect.outputs.latest_version != ''
env:
GH_TOKEN: ${{ github.token }}
run: |
artifact_id=$(gh api \
"/repos/${{ github.repository }}/actions/artifacts?per_page=100" \
--jq '.artifacts[] | select(.expired == false) | select(.name == "expo-beta-tested-${{ steps.detect.outputs.latest_version }}") | .id' \
| head -n 1)

if [ -n "$artifact_id" ]; then
echo "already_tested=true" >> "$GITHUB_OUTPUT"
else
echo "already_tested=false" >> "$GITHUB_OUTPUT"
fi

- name: Finalize test decision
id: finalize
run: |
should_test="${{ steps.detect.outputs.should_test }}"

if [ "${{ steps.tested.outputs.already_tested || 'false' }}" = 'true' ]; then
should_test='false'
fi

echo "latest_version=${{ steps.detect.outputs.latest_version }}" >> "$GITHUB_OUTPUT"
echo "should_test=${should_test}" >> "$GITHUB_OUTPUT"
{
echo "- Already tested successfully: ${{ steps.tested.outputs.already_tested || 'false' }}"
echo "- Final should run road tests: ${should_test}"
echo
} >> "$GITHUB_STEP_SUMMARY"

android:
name: Android road test (Expo beta)
runs-on: ubuntu-latest
needs: prepare
if: needs.prepare.outputs.should_test == 'true'
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6

- name: Apply Expo beta to ExpoApp56
run: node --experimental-strip-types --no-warnings ./scripts/check-expo-beta.ts --expo-version "~55.0.23" --apply --github-step-summary "$GITHUB_STEP_SUMMARY"

- name: Install Expo beta dependencies
run: |
cd apps/ExpoApp56
npx expo install --fix

- name: Run ExpoApp56 -> AndroidApp road test
uses: ./.github/actions/androidapp-road-test
with:
flavor: expo56
rn-project-path: apps/ExpoApp56
rn-project-maven-path: com/callstack/rnbrownfield/demo/expoapp56/brownfieldlib
Comment on lines +71 to +84

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this ExpoAppBeta?


ios:
name: iOS road test (Expo beta)
runs-on: macos-26
needs: prepare
if: needs.prepare.outputs.should_test == 'true'
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6

- name: Apply Expo beta to ExpoApp56
run: node --experimental-strip-types --no-warnings ./scripts/check-expo-beta.ts --expo-version "~55.0.23" --apply --github-step-summary "$GITHUB_STEP_SUMMARY"

- name: Install Expo beta dependencies
run: |
cd apps/ExpoApp56
npx expo install --fix

- name: Run ExpoApp56 -> AppleApp road test
uses: ./.github/actions/appleapp-road-test
with:
variant: expo56
rn-project-path: apps/ExpoApp56
Comment on lines +95 to +107

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here


record-success:
name: Record tested Expo beta
runs-on: ubuntu-latest
needs: [prepare, android, ios]
if: |
needs.prepare.outputs.should_test == 'true' &&
needs.android.result == 'success' &&
needs.ios.result == 'success'
steps:
- name: Create Expo beta success marker
run: |
mkdir -p expo-beta-test-result
printf '%s\n' '${{ needs.prepare.outputs.latest_version }}' > expo-beta-test-result/version.txt

- name: Upload Expo beta success marker
uses: actions/upload-artifact@v4
with:
name: expo-beta-tested-${{ needs.prepare.outputs.latest_version }}
path: expo-beta-test-result/version.txt
retention-days: 90

summarize:
name: Summarize Expo beta road test
runs-on: ubuntu-latest
needs: [prepare, android, ios, record-success]
if: always()
steps:
- name: Write workflow summary
run: |
{
echo "## Expo beta road test results"
echo
echo "- Expo beta version: ${{ needs.prepare.outputs.latest_version || 'not found' }}"
echo "- Android result: ${{ needs.android.result || 'skipped' }}"
echo "- iOS result: ${{ needs.ios.result || 'skipped' }}"
echo
if [ "${{ needs.prepare.outputs.should_test }}" != "true" ]; then
echo "No new untested Expo beta required testing."
else
echo "- Success marker uploaded: ${{ needs.record-success.result == 'success' && 'yes' || 'no' }}"
fi
} >> "$GITHUB_STEP_SUMMARY"

- name: Fail if road test failed
if: |
needs.prepare.outputs.should_test == 'true' &&
(needs.android.result == 'failure' || needs.ios.result == 'failure')
run: exit 1
4 changes: 4 additions & 0 deletions apps/AndroidApp/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ android {
create("expo55") {
dimension = "app"
}
create("expo56") {
dimension = "app"
}
Comment on lines +38 to +40

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's go with expobeta

create("vanilla") {
dimension = "app"
}
Expand Down Expand Up @@ -72,6 +75,7 @@ dependencies {
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.appcompat)
add("expo55Implementation", libs.brownfieldlib.expo55)
add("expo56Implementation", libs.brownfieldlib.expo56)
add("expo54Implementation", libs.brownfieldlib.expo54)
add("vanillaImplementation", libs.brownfieldlib.vanilla)

Expand Down
1 change: 1 addition & 0 deletions apps/AndroidApp/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ gson = "2.13.2"
[libraries]
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
brownfieldlib-expo55 = { module = "com.callstack.rnbrownfield.demo.expoapp55:brownfieldlib", version.ref = "brownfieldlib" }
brownfieldlib-expo56 = { module = "com.callstack.rnbrownfield.demo.expoapp56:brownfieldlib", version.ref = "brownfieldlib" }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's do expobeta

brownfieldlib-expo54 = { module = "com.callstack.rnbrownfield.demo.expoapp54:brownfieldlib", version.ref = "brownfieldlib" }
brownfieldlib-vanilla = { module = "com.rnapp:brownfieldlib", version.ref = "brownfieldlib" }
junit = { group = "junit", name = "junit", version.ref = "junit" }
Expand Down
1 change: 1 addition & 0 deletions apps/AndroidApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"scripts": {
"build:example:android-consumer:expo": "./gradlew assembleExpo55Release",
"build:example:android-consumer:expo55": "./gradlew assembleExpo55Release",
"build:example:android-consumer:expo56": "./gradlew assembleExpo56Release",
"build:example:android-consumer:expo54": "./gradlew assembleExpo54Release",
"build:example:android-consumer:vanilla": "./gradlew assembleVanillaRelease"
}
Expand Down
Loading
Loading