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

Maestro GitHub actions #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
10 changes: 10 additions & 0 deletions .github/actions/build-android/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: 'Build Android App'
description: 'Build the Android app'

runs:
using: 'composite'
steps:
- name: Build Android App
shell: bash
run: ./gradlew assembleRelease
working-directory: android
15 changes: 15 additions & 0 deletions .github/actions/build-ios/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: 'Build iOS App'
description: 'Build the iOS app'

runs:
using: 'composite'
steps:
- name: Build iOS App
shell: bash
run: |
xcodebuild build -scheme 'WeatherApp' \
-configuration Debug \
-workspace 'WeatherApp.xcworkspace' \
-destination 'generic/platform=iOS Simulator' CONFIGURATION_BUILD_DIR=$PWD/build

working-directory: ios
11 changes: 11 additions & 0 deletions .github/actions/install-android/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
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: '17'
distribution: 'adopt'
25 changes: 25 additions & 0 deletions .github/actions/install-ios/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
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
11 changes: 9 additions & 2 deletions .github/actions/install/action.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
name: 'Install dependencies'
description: 'Install dependencies for the project'
inputs:
WEATHER_API_KEY:
description: 'Weather API key'
required: true

runs:
using: 'composite'
steps:
- name: Copy .env file
- name: Create .env file
shell: bash
run: cp .env.template .env
run: |
touch .env
echo WEATHER_API_KEY=${{ inputs.WEATHER_API_KEY }} >> .env

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: E2E Tests

on:
push:
branches: ['main']
pull_request:
branches: ['main']

jobs:
ios-e2e-tests:
runs-on: macos-latest

strategy:
matrix:
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install
with:
WEATHER_API_KEY: ${{ secrets.WEATHER_API_KEY }}
- uses: ./.github/actions/install-ios
- uses: ./.github/actions/build-ios
- uses: mobile-dev-inc/[email protected]
with:
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
app-file: build/WeatherApp.app

android-e2e-tests:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

outputs:
apk: android/app/build/outputs/apk/release/app-release.apk

steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install
with:
WEATHER_API_KEY: ${{ secrets.WEATHER_API_KEY }}
- uses: ./.github/actions/install-android
- uses: ./.github/actions/build-android
- uses: mobile-dev-inc/[email protected]
with:
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
app-file: android/app/build/outputs/apk/release/app-release.apk
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml → .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: CI
name: Unit Tests

on:
push:
Expand All @@ -21,6 +18,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install
with:
WEATHER_API_KEY: ${{ secrets.WEATHER_API_KEY }}

- name: Run TypeScript
env:
Expand Down
2 changes: 1 addition & 1 deletion e2e/flow.yml → .maestro/flow.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
appId: ${APP_ID}
appId: com.weatherapp
---
- launchApp
- assertVisible: 'Weather'
Expand Down
14 changes: 14 additions & 0 deletions .maestro/ios-flow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
appId: org.reactjs.native.example.WeatherApp
---
- launchApp
- assertVisible: 'Weather'
- assertVisible:
id: 'Warsaw'
index: 0
- tapOn:
id: 'Warsaw'
index: 0
- assertVisible: 'Humidity'
- assertVisible: 'Pressure'
- assertVisible: 'Wind'
- assertVisible: 'Visibility'
10 changes: 8 additions & 2 deletions ios/WeatherApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,10 @@
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
);
OTHER_LDFLAGS = "$(inherited) ";
OTHER_LDFLAGS = (
"$(inherited)",
" ",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
USE_HERMES = true;
Expand Down Expand Up @@ -676,7 +679,10 @@
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
);
OTHER_LDFLAGS = "$(inherited) ";
OTHER_LDFLAGS = (
"$(inherited)",
" ",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
USE_HERMES = true;
Expand Down
Loading