-
-
Notifications
You must be signed in to change notification settings - Fork 906
141 lines (121 loc) · 4.58 KB
/
xcode.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
name: Build and test main target
on:
push:
branches:
- master
- develop
pull_request:
types:
- synchronize
- opened
- reopened
- ready_for_review
branches:
- master
- develop
env:
PROJECT: Nextcloud.xcodeproj
DESTINATION: platform=iOS Simulator,name=iPhone 16,OS=18.2
SCHEME: Nextcloud
SERVER_BRANCH: stable30
PHP_VERSION: 8.3
jobs:
build:
name: Build
runs-on: macos-15
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v4
- name: Download GoogleService-Info.plist
run: wget "https://raw.githubusercontent.com/firebase/quickstart-ios/master/mock-GoogleService-Info.plist" -O GoogleService-Info.plist
- name: Run Xcode Build
run: |
set -o pipefail && \
xcodebuild build-for-testing \
-scheme "${{ env.SCHEME }}" \
-destination "${{ env.DESTINATION }}" \
-derivedDataPath "DerivedData" \
| xcbeautify --quieter
- name: Upload Build Products
uses: actions/upload-artifact@v4
with:
name: Nextcloud for iOS
path: DerivedData/Build/Products
retention-days: 4
test:
name: Run Tests
runs-on: macos-15
needs: [build]
# Temporarily, project has no effective tests except UI tests which are unfeasible on virtualized GitHub runners (see #3291)
# Previously: github.event.pull_request.draft == false
if: false
steps:
- uses: actions/checkout@v4
- name: Prepare PHP ${{ env.PHP_VERSION }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
# 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
ini-values: apc.enable_cli=on, disable_functions=
- name: Checkout Nextcloud Server
uses: actions/checkout@v4
with:
submodules: true
repository: nextcloud/server
path: server
ref: ${{ env.SERVER_BRANCH }}
- name: Checkout Download Limits App
uses: actions/checkout@v4
with:
repository: nextcloud/files_downloadlimit
path: server/apps/files_downloadlimit
ref: ${{ env.SERVER_BRANCH }}
- name: Install Nextcloud Server
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 files_downloadlimit
./server/occ background:cron
PHP_CLI_SERVER_WORKERS=5 php -S localhost:8080 -t server/ &
- name: Download Build
uses: actions/download-artifact@v4
with:
name: Nextcloud for iOS
- name: Assert Nextcloud Server Status
run: curl -s --retry 5 --retry-delay 60 --retry-all-errors http://localhost:8080/status.php || true
- name: Boot iOS Simulator
run: |
xcrun simctl boot "iPhone 16"
xcrun simctl bootstatus "iPhone 16" || echo "Simulator booted"
- name: Check if Safari is installed
run: |
if xcrun simctl listapps booted | grep -q com.apple.mobilesafari; then
echo "Safari is installed in the simulator."
else
echo "Safari is NOT installed in the simulator."
exit 1
fi
- name: Run Xcode Test
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"
- name: Upload Xcode Test Results
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: TestResult.xcresult
path: "TestResult.xcresult"