-
Notifications
You must be signed in to change notification settings - Fork 91
186 lines (157 loc) Β· 5.87 KB
/
uitests.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT
name: Build main target
on:
pull_request:
paths:
- '.github/workflows/**'
- NextcloudTalk.xcodeproj/**
- NextcloudTalk/**
- NextcloudTalkTests/**
- NotificationServiceExtension/**
- ShareExtension/**
- BroadcastUploadExtension/**
push:
branches:
- main
- master
- stable*
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
WORKSPACE: NextcloudTalk.xcworkspace
DESTINATION: platform=iOS Simulator,name=iPhone 14,OS=16.2
SCHEME: NextcloudTalk
jobs:
build:
name: Build
runs-on: macos-12
steps:
- name: Checkout app
uses: actions/checkout@v4
with:
submodules: true
- uses: actions/cache@v4
with:
path: Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Set up dependencies talk-ios
run: |
pod install
- name: Build NextcloudTalk iOS for testing
run: |
set -o pipefail && \
xcodebuild build-for-testing \
-workspace '${{ env.WORKSPACE }}' \
-scheme '${{ env.SCHEME }}' \
-destination '${{ env.DESTINATION }}' \
-derivedDataPath 'DerivedData' \
| xcbeautify --quieter
- name: Upload test build
uses: actions/upload-artifact@v4
with:
name: Products
path: DerivedData/Build/Products
retention-days: 4
test:
name: Test
runs-on: macos-12
needs: [build]
strategy:
fail-fast: false
matrix:
# Test with stable23 as well to find regressions in older versions
configs: [
{ talkbranch: 'stable23', serverbranch: 'stable23', phpversion: '8.0' },
{ talkbranch: 'stable27', serverbranch: 'stable27', phpversion: '8.2' },
{ talkbranch: 'stable28', serverbranch: 'stable28', phpversion: '8.2' },
{ talkbranch: 'stable29', serverbranch: 'stable29', phpversion: '8.2' },
{ talkbranch: 'main', serverbranch: 'master', phpversion: '8.2' }
]
steps:
- name: Checkout app
uses: actions/checkout@v4
with:
submodules: true
- name: Set up php ${{ matrix.configs.phpversion }}
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
with:
php-version: ${{ matrix.configs.phpversion }}
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
extensions: apcu, bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, pgsql, pdo_pgsql
coverage: none
ini-file: development
# Temporary workaround for missing pcntl_* in PHP 8.3: ini-values: apc.enable_cli=on
ini-values: apc.enable_cli=on, disable_functions=
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout server
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: true
repository: nextcloud/server
path: server
ref: ${{ matrix.configs.serverbranch }}
- name: Checkout Talk
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: nextcloud/spreed
path: server/apps/spreed
ref: ${{ matrix.configs.talkbranch }}
- name: Set up production dependencies
working-directory: server/apps/spreed
run: composer i --no-dev
- name: Set up Nextcloud
run: |
mkdir server/data
./server/occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin
./server/occ config:system:set hashing_default_password --value=true --type=boolean
./server/occ config:system:set auth.bruteforce.protection.enabled --value false --type bool
./server/occ config:system:set ratelimit.protection.enabled --value false --type bool
./server/occ config:system:set memcache.local --value='\OC\Memcache\APCu'
./server/occ config:system:set memcache.distributed --value='\OC\Memcache\APCu'
./server/occ app:enable --force spreed
./server/occ background:cron
OC_PASS=alice ./server/occ user:add --password-from-env alice
PHP_CLI_SERVER_WORKERS=3 php -S localhost:8080 -t server/ &
- name: Download test-build
uses: actions/download-artifact@v4
with:
name: Products
- name: Check status.php
run: curl -s --retry 5 --retry-delay 5 --retry-all-errors http://localhost:8080/status.php || true
- name: Setup test-specific rooms
run: |
source ./ci-setup-rooms.sh
- name: Test NextcloudTalk iOS
run: |
set -o pipefail && \
xcodebuild test-without-building \
-xctestrun $(find . -type f -name '*.xctestrun') \
-destination '${{ env.DESTINATION }}' \
-derivedDataPath 'DerivedData' \
-test-iterations 3 \
-retry-tests-on-failure \
-resultBundlePath 'testResult.xcresult' \
| xcbeautify --quieter
- name: Upload test results
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: testResults-${{ matrix.configs.talkbranch }}.xcresult
path: 'testResult.xcresult'
summary:
permissions:
contents: none
runs-on: ubuntu-latest-low
needs: [test]
if: always()
name: build-and-test-summary
steps:
- name: Summary status
run: if ${{ needs.test.result != 'success' }}; then exit 1; fi