Skip to content

Commit 1e5a5f0

Browse files
committed
chore: implement iOS testing on BrowserStack
1 parent 73f37d6 commit 1e5a5f0

File tree

1 file changed

+41
-13
lines changed

1 file changed

+41
-13
lines changed

.github/workflows/ci.yml

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ on:
1010

1111
env:
1212
nodejs: "16.x"
13+
java_version: "17"
14+
gradle_version: "7.6.1"
1315
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
1416
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
1517

@@ -47,12 +49,25 @@ jobs:
4749
- name: Build test app
4850
run: scripts/build-test-app.sh --ios --emulator
4951
- name: Upload artifact to BrowserStack
50-
if: env.BROWSERSTACK_USERNAME != ''
52+
if: ${{ secrets.BROWSERSTACK_USERNAME != '' }}
5153
run: scripts/upload-browserstack.sh --ios
52-
# need to have an App for device target
53-
# - name: Run e2e tests
54-
# if: env.BROWSERSTACK_USERNAME != ''
55-
# run: scripts/test-app.sh --ios --device
54+
55+
test-ios:
56+
if: ${{ secrets.BROWSERSTACK_USERNAME != '' }}
57+
needs: build-ios
58+
runs-on: macOS-latest
59+
steps:
60+
- uses: actions/checkout@v1
61+
- name: Install Node.js ${{ env.nodejs }}
62+
uses: actions/setup-node@v4
63+
with:
64+
node-version: ${{ env.nodejs }}
65+
cache: npm
66+
cache-dependency-path: package-lock.json
67+
- name: Install node modules
68+
run: npm ci
69+
- name: Run e2e tests (iOS)
70+
run: scripts/test-app.sh --ios --device
5671

5772
build-android:
5873
runs-on: ubuntu-latest
@@ -70,17 +85,16 @@ jobs:
7085
uses: actions/setup-java@v2
7186
with:
7287
distribution: "zulu"
73-
java-version: "17"
88+
java-version: ${{ env.java_version }}
7489
java-package: jdk
7590
- name: Ensure Android build-tools 33.0.2
7691
run: yes | "${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" "build-tools;33.0.2"
77-
- name: Install Gradle 7.6.1
92+
- name: Install Gradle ${{ env.gradle_version }}
7893
run: |
7994
set -euo pipefail
80-
GRADLE_VERSION=7.6.1
81-
curl -sSL "https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip" -o gradle.zip
95+
curl -sSL "https://services.gradle.org/distributions/gradle-${{ env.gradle_version }}-bin.zip" -o gradle.zip
8296
unzip -q gradle.zip -d "$HOME/gradle"
83-
echo "$HOME/gradle/gradle-${GRADLE_VERSION}/bin" >> "$GITHUB_PATH"
97+
echo "$HOME/gradle/gradle-${{ env.gradle_version }}/bin" >> "$GITHUB_PATH"
8498
rm gradle.zip
8599
- name: Update test cert for httpbin.org
86100
run: npm run update:cert
@@ -101,8 +115,22 @@ jobs:
101115
- name: Build test app
102116
run: scripts/build-test-app.sh --android --device
103117
- name: Upload artifact to BrowserStack
104-
if: env.BROWSERSTACK_USERNAME != ''
118+
if: ${{ secrets.BROWSERSTACK_USERNAME != '' }}
105119
run: scripts/upload-browserstack.sh --android
106-
- name: Run e2e tests
107-
if: env.BROWSERSTACK_USERNAME != ''
120+
121+
test-android:
122+
if: ${{ secrets.BROWSERSTACK_USERNAME != '' }}
123+
needs: build-android
124+
runs-on: ubuntu-latest
125+
steps:
126+
- uses: actions/checkout@v1
127+
- name: Install Node.js ${{ env.nodejs }}
128+
uses: actions/setup-node@v4
129+
with:
130+
node-version: ${{ env.nodejs }}
131+
cache: npm
132+
cache-dependency-path: package-lock.json
133+
- name: Install node modules
134+
run: npm ci
135+
- name: Run e2e tests (Android)
108136
run: scripts/test-app.sh --android --device

0 commit comments

Comments
 (0)