Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
13 changes: 13 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Application Environment (development | preview | production)
EXPO_PUBLIC_APP_ENV=development

# API Configuration
EXPO_PUBLIC_API_URL=https://dummyjson.com/

# Example Variables
EXPO_PUBLIC_VAR_NUMBER=10
EXPO_PUBLIC_VAR_BOOL=true

# Build-time only secrets (no EXPO_PUBLIC prefix - NOT accessible in src folder)
SECRET_KEY=my-secret-key
APP_BUILD_ONLY_VAR=build-only-value
85 changes: 85 additions & 0 deletions .github/actions/eas-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# 🔗 Links:
# Source file: https://github.com/obytes/react-native-template-obytes/blob/master/.github/actions/eas-build/action.yml
# EAS Build docs: https://docs.expo.dev/eas-update/github-actions/

# ✍️ Description:
# This is a composite action, which means it can be used in other actions.
# This action is used to trigger an EAS Build for a specific environment (development, staging, production).
# This action accepts those inputs:
# `APP_ENV`, which is used to generate an APK for a specific environment (development, staging, production). We use staging by default.
# `AUTO_SUBMIT`, false by default, set to true if you want to automatically submit your build to stores.
# `EXPO_TOKEN`, required, access token for your Expo account. https://expo.dev/settings/access-tokens
# `VERSION`, required, version of the app to build. used as the build message.
# `ANDROID`, true by default, set to true if you don't want to trigger build for Android.
# `IOS`, false by default, set to true if you want to trigger build for IOS.

# Before triggering the build, we run a pre-build script to generate the necessary native folders based on the APP_ENV.
# Based on the ANDROID and IOS inputs, we trigger the build for the corresponding platform with the corresponding flags.

# 👀 Example usage:
# - name: ⏱️ EAS Build
# uses: ./.github/actions/eas-build
# with:
# APP_ENV: staging
# EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
# VERSION: ${{ github.event.release.tag_name }}
# IOS: false

name: 'Setup EAS Build + Trigger Build'
description: 'Setup EAS Build + Trigger Build'
inputs:
APP_ENV:
description: 'APP_ENV (one of): development, staging, production'
required: true
default: staging
AUTO_SUBMIT: # # TODO: we need to handle this too
description: 'AUTO_SUBMIT (one of): true, false'
required: true
default: 'false'
ANDROID:
description: 'run for ANDROID (one of): true, false'
required: true
default: 'true'
VERSION:
description: VERSION
required: true
default: 0.0.0
IOS:
description: 'run for IOS (one of): true, false'
required: true
default: 'false'
EXPO_TOKEN:
description: EXPO_TOKEN
required: true
default: 'false'

runs:
using: composite
steps:
- name: 💯 Check for EXPO_TOKEN
run: |
if [ -z "${{ inputs.EXPO_TOKEN }}" ]; then
echo "You must provide an EXPO_TOKEN secret linked to this project's Expo account in this repo's secrets. Learn more: https://docs.expo.dev/eas-update/github-actions"
exit 1
fi
shell: bash

- name: 📦 Setup Expo and EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ inputs.EXPO_TOKEN }}

- name: ⚙️ Run Prebuild
run: pnpm prebuild:${{ inputs.APP_ENV }}
shell: bash

- name: 📱 Run Android Build
if: ${{ inputs.ANDROID == 'true' }}
run: pnpm build:${{ inputs.APP_ENV }}:android --non-interactive --no-wait --message "Build ${{ inputs.APP_ENV }} ${{ inputs.VERSION }}"
shell: bash

- name: 📱 Run IOS Build
if: ${{ inputs.IOS == 'true' }}
run: pnpm build:${{ inputs.APP_ENV }}:ios --non-interactive --no-wait --message "Build ${{ inputs.APP_ENV }} ${{ inputs.VERSION }}"
shell: bash
6 changes: 3 additions & 3 deletions .github/actions/setup-jdk-generate-apk/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ inputs:
APP_ENV:
description: 'APP_ENV (one of): development, staging, production'
required: true
default: 'staging'
default: staging

runs:
using: 'composite'
using: composite
steps:
- name: Set Up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu' # See 'Supported distributions' for available options
distribution: zulu # See 'Supported distributions' for available options
java-version: '17'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/setup-node-pnpm-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
name: 'Setup Node + PNPM + Install Dependencies'
description: 'Setup Node + PNPM + Install Dependencies'
runs:
using: 'composite'
using: composite
steps:
- uses: pnpm/action-setup@v4
name: Install pnpm
Expand All @@ -24,7 +24,7 @@ runs:
name: Install Node.js
with:
node-version: 20
cache: 'pnpm'
cache: pnpm

- name: 📦 Install Project Dependencies
run: pnpm install --frozen-lockfile
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e-android-eas-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
inputs:
apk-url:
type: string
description: 'EAS APK URL'
description: EAS APK URL
required: true
default: ''

Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
fetch-depth: 0

- name: 📦 Install Maestro
run: npm run install-maestro ## We use npm because we don't need to install deps again
run: npm run install-maestro # # We use npm because we don't need to install deps again

- name: Download Test APK
uses: actions/download-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
fetch-depth: 0

- name: 📦 Install Maestro
run: npm run install-maestro ## We use npm because we don't need to install deps again
run: npm run install-maestro # # We use npm because we don't need to install deps again

- name: Download Test APK
uses: actions/download-artifact@v3
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/expo-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ on:
- main
- master
paths:
- 'package.json'
- 'pnpm-lock.yaml'
- package.json
- pnpm-lock.yaml
pull_request:
paths:
- 'package.json'
- 'pnpm-lock.yaml'
- package.json
- pnpm-lock.yaml

permissions:
contents: read
pull-requests: write

jobs:
doctor:
name: Expo Doctor (expo)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-ts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
permissions:
contents: read
pull-requests: write

jobs:
lint:
name: Lint TS (eslint, prettier)
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
permissions:
contents: read
pull-requests: write

jobs:
stale:
runs-on: ubuntu-latest
Expand All @@ -16,9 +16,9 @@ jobs:
- uses: actions/stale@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 14 days'
stale-pr-message: 'This PR is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 14 days'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
stale-issue-message: This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 14 days
stale-pr-message: This PR is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 14 days
stale-issue-label: no-issue-activity
stale-pr-label: no-pr-activity
days-before-stale: 60
days-before-close: 14
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
if: (success() || failure()) && github.event_name == 'pull_request'
with:
coverage-summary-path: ./coverage/coverage-summary.json
summary-title: '💯 Test Coverage'
summary-title: 💯 Test Coverage
badge-title: Coverage
create-new-comment: false
junitxml-title: 😎 Tests Results
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ yarn-error.log

# macOS
.DS_Store
/ios
/android

# artifacts
*.apks
Expand Down
24 changes: 12 additions & 12 deletions .maestro/app/create-post.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
appId: ${APP_ID}
env:
Title: 'Post title'
Title: Post title
CONTENT:
"It is a long established fact that a reader will be distracted by the\
\ readable content of a page when looking at its layout. The point of using Lorem\
Expand All @@ -9,21 +9,21 @@ env:
---
- launchApp
- runFlow: ../utils/onboarding-and-login.yaml
- assertVisible: 'Feed'
- assertVisible: 'Create'
- tapOn: 'Create'
- assertVisible: 'Add Post'
- assertVisible: Feed
- assertVisible: Create
- tapOn: Create
- assertVisible: Add Post
- tapOn:
id: 'title'
id: title
- inputText: ${Title}
- tapOn:
id: 'body-input'
- inputText: 'short content'
id: body-input
- inputText: short content
- tapOn:
id: 'add-post-button'
- assertVisible: 'String must contain at least 120 character(s)'
id: add-post-button
- assertVisible: String must contain at least 120 character(s)
- inputText: ${CONTENT}
- runFlow: ../utils/hide-keyboard.yaml
- tapOn:
id: 'add-post-button'
- assertVisible: 'Post added successfully'
id: add-post-button
- assertVisible: Post added successfully
20 changes: 10 additions & 10 deletions .maestro/app/tabs.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
appId: ${APP_ID}
env:
Name: 'User'
EMAIL: 'user@test.com'
PASSWORD: 'password'
Name: User
EMAIL: user@test.com
PASSWORD: password
---
- launchApp
- runFlow: ../utils/onboarding-and-login.yaml
- assertVisible: 'Feed'
- assertVisible: Feed
- assertVisible:
id: 'style-tab'
id: style-tab
- tapOn:
id: 'style-tab'
- assertVisible: 'Typography'
id: style-tab
- assertVisible: Typography
- tapOn:
id: 'settings-tab'
- assertVisible: 'Settings'
id: settings-tab
- assertVisible: Settings
- scroll
- assertVisible: 'Logout'
- assertVisible: Logout
32 changes: 16 additions & 16 deletions .maestro/auth/login-with-validation.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
appId: ${APP_ID}
env:
Name: 'User'
EMAIL: 'user@test.com'
PASSWORD: 'password'
Name: User
EMAIL: user@test.com
PASSWORD: password
---
- launchApp
- runFlow:
when:
visible: 'Obytes Starter'
visible: Obytes Starter
file: ../utils/onboarding.yaml
- assertVisible: 'Sign In'
- assertVisible: Sign In
- assertVisible:
id: 'login-button'
id: login-button
- tapOn:
id: 'login-button'
- assertVisible: 'Email is required'
- assertVisible: 'Password is required'
id: login-button
- assertVisible: Email is required
- assertVisible: Password is required
- tapOn:
id: 'name'
id: name
- inputText: ${Name}
- runFlow: ../utils/hide-keyboard.yaml
- tapOn:
id: 'email-input'
- inputText: 'email'
- assertVisible: 'Invalid email format'
id: email-input
- inputText: email
- assertVisible: Invalid email format
- inputText: ${EMAIL}
- runFlow: ../utils/hide-keyboard.yaml
- tapOn:
id: 'password-input'
id: password-input
- inputText: ${PASSWORD}
- runFlow: ../utils/hide-keyboard.yaml
- tapOn:
id: 'login-button'
- assertVisible: 'Feed'
id: login-button
- assertVisible: Feed
4 changes: 2 additions & 2 deletions .maestro/auth/onboarding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ appId: ${APP_ID}
---
- clearState
- launchApp
- assertVisible: "Obytes Starter"
- assertVisible: Obytes Starter
- assertVisible: "Let's Get Started "
- tapOn: "Let's Get Started "
- assertVisible: "Sign In"
- assertVisible: Sign In
8 changes: 4 additions & 4 deletions .maestro/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ excludeTags:
- util

executionOrder:
continueOnFailure: false # default is true
flowsOrder:
- onboarding
- login-with-validation
continueOnFailure: false # default is true
flowsOrder:
- onboarding
- login-with-validation
2 changes: 1 addition & 1 deletion .maestro/utils/hide-keyboard-android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ appId: ${APP_ID}
tags:
- util
---
- hideKeyboard
- hideKeyboard
2 changes: 1 addition & 1 deletion .maestro/utils/hide-keyboard-ios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ tags:
- util
---
- tapOn:
id: "Return" # Keyboard Return
id: Return # Keyboard Return
Loading
Loading