forked from expo/expo
-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (108 loc) · 3.95 KB
/
updates-e2e.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Updates e2e
on:
workflow_dispatch: {}
pull_request:
paths:
- .github/workflows/updates-e2e.yml
- packages/expo-json-utils/**
- packages/expo-manifests/**
- packages/expo-modules-core/**
- packages/expo-structured-headers/**
- packages/expo-updates-interface/**
- packages/expo-updates/**
- packages/expo/android/**
- packages/expo/ios/**
- templates/expo-template-bare-minimum/**
push:
branches: [main, 'sdk-*']
paths:
- .github/workflows/updates-e2e.yml
- packages/expo-json-utils/**
- packages/expo-manifests/**
- packages/expo-modules-core/**
- packages/expo-structured-headers/**
- packages/expo-updates-interface/**
- packages/expo-updates/**
- packages/expo/android/**
- packages/expo/ios/**
- templates/expo-template-bare-minimum/**
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# (2022-05): we run both iOS and Android tests in a single job in order to avoid taking up 2 macOS
# runners each time this workflow runs
build:
runs-on: macos-11
timeout-minutes: 120
env:
UPDATES_PORT: 4747
strategy:
matrix:
api-level: [31]
steps:
- name: 👀 Checkout
uses: actions/checkout@v3
- name: ⬢ Setup Node
uses: actions/setup-node@v3
with:
node-version: '16'
- name: 🔨 Switch to Xcode 13.2.1
run: sudo xcode-select --switch /Applications/Xcode_13.2.1.app
- name: 🔨 Use JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: ➕ Add `bin` to GITHUB_PATH
run: echo "$(yarn global bin)" >> $GITHUB_PATH
- name: ♻️ Restore caches
uses: ./.github/actions/expo-caches
id: expo-caches
with:
yarn-workspace: 'true'
avd: 'true'
avd-api: ${{ matrix.api-level }}
- name: 🧶 Yarn install
if: steps.expo-caches.outputs.yarn-workspace-hit != 'true'
run: yarn install --frozen-lockfile
- name: 🛠 Build local Expo CLI
working-directory: packages/@expo/cli
run: yarn prepare
- name: Build expo-updates CLI
working-directory: packages/expo-updates
run: yarn build:cli
- name: 🔧 Install Expo CLI
run: yarn global add expo-cli
- name: 🌳 Add EXPO_REPO_ROOT to environment
run: echo "EXPO_REPO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV
- name: 🌐 Get local IP address
run: echo "UPDATES_HOST=$(ifconfig -l | xargs -n1 ipconfig getifaddr)" >> $GITHUB_ENV
- name: 📦 Get artifacts path
run: mkdir -p artifact && echo "ARTIFACTS_DEST=$(pwd)/artifact" >> $GITHUB_ENV
- name: 🚀 Setup test project and build
run: node packages/expo-updates/e2e/__tests__/setup/index.js
- name: Upload test project artifacts
uses: actions/upload-artifact@v3
with:
name: updates-e2e-artifacts
path: artifact
- name: 🍏 Start iOS simulator
run: |
xcrun simctl list devices -j \
| jq -rc '[ .[] | .[] | .[] | select( .name | contains( "iPhone" ) ) | select( .isAvailable == true ) ] | last.udid ' \
| xargs open -a Simulator --args -CurrentDeviceUDID
- name: 🍏 Run iOS tests
timeout-minutes: 30
working-directory: packages/expo-updates
run: yarn test --config e2e/jest.config.ios.js --runInBand
- name: 🤖 Start Android emulator and run tests
timeout-minutes: 30
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
avd-name: avd-${{ matrix.api-level }}
arch: x86_64
force-avd-creation: false
script: yarn test --config e2e/jest.config.android.js --runInBand
working-directory: packages/expo-updates