-
Notifications
You must be signed in to change notification settings - Fork 15
136 lines (115 loc) · 4.71 KB
/
ios_integration_test.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: IOS CI
on:
push:
branches: [master, f-droid]
tags:
- "*"
pull_request:
branches: [master, f-droid]
env:
NODE_VERSION: 18.14.2
JAVA_VERSION: 12.x
ARTIFACT_PATH: ./screenshots
jobs:
cancel_previous_runs:
name: Cancel Previous Runs
runs-on: ubuntu-20.04
steps:
- uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
ios_device_test:
runs-on: macos-13
timeout-minutes: 60
strategy:
matrix:
# See up to date screenshots specifications for Appstores:
# https://developer.apple.com/help/app-store-connect/reference/screenshot-specifications/
include:
- device: "iPhone 14 Pro Max"
record_video: true
# With this flag we can run the CI against different node versions to check compatibility.
docker_tag: "1.5.1"
- device: "iPhone 8 Plus"
record_video: false
docker_tag: "1.5.1"
- device: "iPad Pro (12.9-inch) (6th generation)"
record_video: false
docker_tag: "1.5.1"
- device: "iPad Pro (12.9-inch) (2nd generation)"
record_video: false
docker_tag: "1.5.1"
fail-fast: false
steps:
# Setup Environment
- uses: actions/checkout@v3
- name: prepare xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "14.3"
- name: "Prepare environment for ios"
working-directory: ./scripts
run: ./ios_init_env.sh
- uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: "zulu"
- name: Install flutter wrapper
run: ./scripts/install_flutter_wrapper.sh
- name: "Create Simulator if iPad Pro 2nd gen"
if: ${{ matrix.device == 'iPad Pro (12.9-inch) (2nd generation)' }}
# Unfortunately it is not deterministic if the 16.2 or the 16.4 runtime is available
run: |
xcrun simctl create "iPad Pro (12.9-inch) (2nd generation)" "com.apple.CoreSimulator.SimDeviceType.iPad-Pro--12-9-inch---2nd-generation-" "com.apple.CoreSimulator.SimRuntime.iOS-16-4" || \
xcrun simctl create "iPad Pro (12.9-inch) (2nd generation)" "com.apple.CoreSimulator.SimDeviceType.iPad-Pro--12-9-inch---2nd-generation-" "com.apple.CoreSimulator.SimRuntime.iOS-16-2"
- name: "Create Simulator if iPad 8 Plus"
if: ${{ matrix.device == 'iPhone 8 Plus' }}
# Unfortunately it is not deterministic if the 16.2 or the 16.4 runtime is available
run: |
xcrun simctl create "iPhone 8 Plus" "com.apple.CoreSimulator.SimDeviceType.iPhone-8-Plus" "com.apple.CoreSimulator.SimRuntime.iOS-16-4" || \
xcrun simctl create "iPhone 8 Plus" "com.apple.CoreSimulator.SimDeviceType.iPhone-8-Plus" "com.apple.CoreSimulator.SimRuntime.iOS-16-2"
# JS Stuff
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Get dependencies (i.e., melos)
run: .flutter/bin/dart pub get
- name: Melos Bootstrap
run: .flutter/bin/dart run melos bootstrap
- name: "Build JS"
run: .flutter/bin/dart run melos yarn-build
- name: Start colima a docker runtime for MacOs
# Work around an upstream issue with the runner image:
# https://github.com/actions/runner-images/issues/8500
run: |
brew upgrade || brew link --overwrite python@3.11
brew install docker
brew install colima
colima start
- name: Run encointer-node
run: ./scripts/docker_run_encointer_node_notee.sh ${{ matrix.docker_tag }} &
- name: Bootstrap Demo Community
run: ./scripts/docker_run_encointer_client_bootstrap_demo_community.sh ${{ matrix.docker_tag }}
- name: "Start Simulator"
working-directory: ./scripts
env:
DEVICE_ID: ${{ matrix.device }}
run: source ./ios_emulator.sh
- name: Run integration tests with printscreens in all languages
if: startsWith(github.ref, 'refs/tags/')
run: ./scripts/multi_language_screenshot_ci_test.sh
env:
TEMP_DIR: ${{ env.ARTIFACT_PATH }}
RECORD: ${{ matrix.record_video }}
- name: Run integration tests with printscreens in en only
if: startsWith(github.ref , 'refs/tags/') != true
run: ./scripts/ios_integration_test.sh
env:
TEMP_DIR: ${{ env.ARTIFACT_PATH }}
RECORD: ${{ matrix.record_video }}
- name: "Upload screenshots and recording"
if: always()
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.device }}
path: ${{ env.ARTIFACT_PATH }}