fix: improve language selection resolution #124
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
name: Appium E2E Tests on BrowserStack | |
on: | |
pull_request: | |
branches: | |
- main | |
- develop | |
- 'release/**' | |
types: [opened, synchronize, reopened, ready_for_review] | |
concurrency: | |
group: e2e-tests-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-apk: | |
runs-on: ubuntu-latest | |
outputs: | |
app_url: ${{ steps.upload.outputs.app_url }} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Setup EAS | |
uses: expo/expo-github-action@v8 | |
with: | |
eas-version: latest | |
token: ${{ secrets.EXPO }} | |
- name: Free Up Space | |
run: | | |
echo "Disk space before cleanup:" | |
df -h | |
sudo rm -rf /usr/local/.ghcup | |
sudo rm -rf /opt/hostedtoolcache/CodeQL | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf /usr/local/share/boost | |
sudo apt-get clean | |
echo "Disk space after cleanup:" | |
df -h | |
- name: Cache Dependencies | |
id: cache-dependencies | |
uses: actions/cache@v4 | |
with: | |
path: | | |
path: | | |
~/.gradle/caches/ | |
~/.gradle/wrapper/ | |
~/.gradle/daemon/ | |
node_modules | |
key: dependencies-cache-${{ hashFiles('package-lock.json') }} | |
restore-keys: | | |
dependencies-cache- | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
cache: 'npm' | |
- name: Install Dependencies | |
if: steps.cache-dependencies.outputs.cache-hit != 'true' | |
run: npm ci | |
- name: Build APK | |
env: | |
SENTRY_DISABLE_AUTO_UPLOAD: 'true' | |
EXPO_PUBLIC_E2E_TEST: 'true' | |
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }} | |
COMAPEO_METRICS_URL: ${{ secrets.COMAPEO_METRICS_URL }} | |
COMAPEO_METRICS_API_KEY: ${{ secrets.COMAPEO_METRICS_API_KEY }} | |
run: | | |
npm run extract-messages | |
npx expo prebuild -p android | |
eas build --platform android --profile test --local | |
- name: Find Built APK | |
id: find-apk | |
run: echo "APK_PATH=$(ls -t build-*.apk | head -n 1)" >> $GITHUB_ENV | |
- name: Upload APK to BrowserStack | |
id: upload | |
run: | | |
APP_URL=$(curl -u "$BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY" \ | |
-X POST "https://api-cloud.browserstack.com/app-automate/upload" \ | |
-F "file=@$APK_PATH" | jq -r '.app_url') | |
echo "app_url=$APP_URL" >> $GITHUB_ENV | |
echo "app_url=$APP_URL" >> $GITHUB_OUTPUT | |
env: | |
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} | |
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} | |
run-e2e-tests: | |
runs-on: ubuntu-latest | |
needs: build-apk | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
cache: 'npm' | |
- name: Install Dependencies | |
run: npm ci | |
- name: Run Webdriver IO E2E Tests on BrowserStack | |
run: | | |
set -o pipefail | |
mkdir -p test-results | |
npx wdio run wdio.config.js --spec ./tests/e2e/specs/ | tee test-results/spec-log.txt | |
env: | |
BROWSERSTACK_APP_URL: ${{ needs.build-apk.outputs.app_url }} | |
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} | |
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} | |
- name: Upload Spec Reporter Logs | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: spec-reporter-logs-${{ github.event.pull_request.number || github.run_number }} | |
path: test-results/spec-log.txt |