Skip to content

Add e2e tests

Add e2e tests #53

Workflow file for this run

name: Continuous Integration
on:
pull_request:
push:
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 20
cache: "yarn"
cache-dependency-path: "yarn.lock"
- name: Install node dependencies
run: yarn install --frozen-lockfile
- name: Run linter
run: yarn lint
run-tests:
needs: lint
runs-on: macos-12
strategy:
fail-fast: true
matrix:
include:
- name: Legacy architecture
scheme: TvOSExample
pod_install_command: pod install
- name: Fabric architecture
scheme: FabricTvOSExample
pod_install_command: RCT_NEW_ARCH_ENABLED=1 pod install
steps:
- name: checkout
uses: actions/checkout@v4
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 20
cache: "yarn"
cache-dependency-path: |
yarn.lock
${{ matrix.scheme }}/yarn.lock
- name: Install package node dependencies
run: yarn install --immutable
- name: Publish package locally
run: yarn dlx yalc publish
- name: Install local package
working-directory: ${{ matrix.scheme }}
run: yarn dlx yalc add rn-tvos-tab-bar
- name: Install example project node dependencies
working-directory: ${{ matrix.scheme }}
run: yarn install --no-immutable
- name: Install pods
working-directory: ${{ matrix.scheme }}/ios
run: ${{ matrix.pod_install_command }}
- name: Build app
working-directory: ${{ matrix.scheme }}
run: yarn build:tvos > build.log
- name: Extract outputh path
working-directory: ${{ matrix.scheme }}
run: path=$(grep -o '^Touch .*\.app' build.log | sed 's/Touch //')
- name: Install Appium driver
run: yarn dlx appium driver install xcuitest
- name: Start Appium server
run: nohup yarn dlx appium server 2>&1 > "${{ matrix.scheme }}/appium.log" &
- name: Display appium logs
uses: webiny/action-post-run@3.0.0
with:
run: cat "${{ matrix.scheme }}/appium.log"
- name: Run End-to-End tests
working-directory: ${{ matrix.scheme }}
run: APP_PATH=$path yarn test
# - name: Display path
# run: 'echo "Extracted Path from Environment Variable: $APP_PATH"'
# uses: sersoft-gmbh/xcodebuild-action@v3
# with:
# workspace: ${{ matrix.scheme }}/ios/${{ matrix.scheme }}.xcworkspace
# scheme: ${{ matrix.scheme }}-tvOS
# destination: platform=TvOS Simulator,name=Apple TV
# action: clean build
# build-settings: CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO