-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8ac9e7a
commit d23b75a
Showing
6 changed files
with
112 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: 'Build iOS App' | ||
description: 'Build the iOS app' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Build iOS App | ||
run: | | ||
xcodebuild -project ios/WeatherApp.xcodeproj \ | ||
-scheme WeatherApp \ | ||
-configuration Debug \ | ||
-sdk iphonesimulator \ | ||
-derivedDataPath build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: 'Install Android dependencies' | ||
description: 'Install dependencies for the project' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: 'Install iOS dependencies' | ||
description: 'Install dependencies for the project' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: '3.0' | ||
bundler-cache: true | ||
|
||
- name: Install Bundler | ||
shell: bash | ||
run: bundle install | ||
working-directory: ios | ||
|
||
- name: Install CocoaPods | ||
shell: bash | ||
run: sudo gem install cocoapods | ||
|
||
- name: Install Pods | ||
shell: bash | ||
run: pod install | ||
working-directory: ios |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: 'Install Maestro dependencies' | ||
description: 'Install dependencies for the project' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Install dependencies and Maestro | ||
shell: bash | ||
run: | | ||
export MAESTRO_VERSION=1.36.0 | ||
curl -Ls "https://get.maestro.mobile.dev" | bash | ||
brew tap facebook/fb | ||
brew install facebook/fb/idb-companion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: E2E Tests | ||
|
||
on: | ||
push: | ||
branches: ['main'] | ||
pull_request: | ||
branches: ['main'] | ||
|
||
jobs: | ||
run-e2e-tests: | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/install | ||
- uses: ./.github/actions/install-ios | ||
- uses: ./.github/actions/install-android | ||
- uses: ./.github/actions/install-maestro | ||
- uses: ./.github/actions/build-ios | ||
|
||
- name: Start iOS Simulator | ||
run: | | ||
# Find a simulator by name (e.g., iPhone 15) | ||
DEVICE_ID=$(xcrun simctl list devices available --json | jq -r '.devices[] | .[] | select(.name == "iPhone 15") | .udid' | head -n 1) | ||
DEVICE_STATE=$(xcrun simctl list devices available --json | jq -r --arg DEVICE_ID "$DEVICE_ID" '.devices[] | .[] | select(.udid == $DEVICE_ID) | .state') | ||
if [ -z "$DEVICE_ID" ]; then | ||
echo "No available simulator found for the criteria." | ||
exit 1 | ||
fi | ||
echo "DEVICE_ID=$DEVICE_ID" >> $GITHUB_ENV | ||
if [ "$DEVICE_STATE" != "Booted" ]; then | ||
# Boot the simulator if it's not already booted | ||
xcrun simctl boot "$DEVICE_ID" | ||
# Wait a bit for the simulator to boot | ||
sleep 30 | ||
DEVICE_STATE=$(xcrun simctl list devices available --json | jq -r --arg DEVICE_ID "$DEVICE_ID" '.devices[] | .[] | select(.udid == $DEVICE_ID) | .state') | ||
if [ "$DEVICE_STATE" != "Booted" ]; then | ||
echo "Failed to boot the simulator in 30s with DEVICE_ID=$DEVICE_ID." | ||
exit 1 | ||
fi | ||
else | ||
echo "Simulator with DEVICE_ID=$DEVICE_ID is already booted." | ||
fi | ||
- name: Run Maestro UI tests | ||
run: | | ||
export PATH="$PATH:$HOME/.maestro/bin" | ||
xcrun simctl install $DEVICE_ID build/Build/Products/Debug-iphonesimulator/WeatherApp.app | ||
maestro --device $DEVICE_ID test ./maestro/flow.yml APP_ID=org.reactjs.native.example.WeatherApp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters