Skip to content

Commit ed9d424

Browse files
Merge branch 'customized-master' of https://github.com/nextmcloud/ios into customized-master
2 parents 48a7615 + 9be8b8d commit ed9d424

731 files changed

Lines changed: 50305 additions & 9327 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/CODEOWNERS‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
# Default owner for all files in the repository.
5+
* @marinofaggiana @mpivchev

‎.github/dependabot.yml‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# SPDX-FileCopyrightText: Nextcloud GmbH
2+
# SPDX-FileCopyrightText: 2026 Milen Pivchev
3+
# SPDX-License-Identifier: GPL-3.0-or-later
4+
5+
version: 2
6+
updates:
7+
# SPM packages declared in Nextcloud.xcodeproj (NextcloudKit, Realm, Firebase, …)
8+
- package-ecosystem: "swift"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"
12+
open-pull-requests-limit: 10
13+
labels:
14+
- "dependencies"
15+
commit-message:
16+
prefix: "fix(deps)"
17+
18+
# Keep the GitHub Actions used by our workflows up to date
19+
- package-ecosystem: "github-actions"
20+
directory: "/"
21+
schedule:
22+
interval: "weekly"
23+
labels:
24+
- "dependencies"
25+
commit-message:
26+
prefix: "ci"
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
# SPDX-FileCopyrightText: Nextcloud GmbH
3+
# SPDX-FileCopyrightText: 2026 Milen Pivchev
4+
# SPDX-License-Identifier: GPL-3.0-or-later
5+
name: github-actions-failure-debugging
6+
description: Debug and fix failing GitHub Actions workflows (CI) in this repo — failing PR checks, xcodebuild/simulator/runner-image errors, SwiftLint failures. Use when asked to review, debug, or fix CI or a failing workflow run.
7+
---
8+
9+
# Debugging failing GitHub Actions workflows
10+
11+
Workflows live in `.github/workflows/`:
12+
13+
- `xcode.yml` — builds the `Nextcloud` scheme for testing, then runs tests on a simulator against a locally installed Nextcloud server. Version pins are env vars at the top: `XCODE_VERSION`, `DESTINATION`, plus the `runs-on` labels and the `simctl boot` device name further down.
14+
- `additional-targets.yml` — builds the extension schemes (Share, File Provider, Notification Service, Widget, WidgetDashboardIntentHandler). Keep its image/Xcode/destination consistent with `xcode.yml`.
15+
- `lint.yml` — SwiftLint on ubuntu.
16+
17+
## 1. Get the failure
18+
19+
Use the `gh` CLI (if a GitHub MCP server is connected, its equivalents like `list_workflow_runs` / `get_job_logs` work too):
20+
21+
- `gh pr checks <pr>` or `gh run list --branch <branch> --limit 10` — find failing runs
22+
- `gh run view <run-id>` — see which jobs and steps failed
23+
- `gh run view <run-id> --log-failed | grep -iE "error:|failed" | head -60` — never dump full logs into context; grep/tail them, or have a subagent read them and report only the failing step and error lines.
24+
25+
## 2. Classify before fixing
26+
27+
- `cannot find type '…' in scope` for Apple APIs → SDK mismatch: the code uses APIs newer than the SDK of the Xcode selected on the runner. Confirm the API's introduction version by grepping the local SDK, e.g.
28+
`grep -rn -B4 "TypeName" /Applications/Xcode-*.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/<Framework>.framework/Modules/*.swiftmodule/*.swiftinterface`
29+
and look for `@available(iOS X.0, …)`.
30+
- "Unable to find a destination" or simulator boot errors → the pinned `DESTINATION` OS/device or the `simctl boot` device name doesn't exist on the runner image.
31+
- Job queued forever or tooling missing → invalid or stale `runs-on` label.
32+
- Test-job failures around PHP/occ → the Nextcloud server setup steps; these shell steps can be reproduced locally.
33+
- SwiftLint failures → run `swiftlint` locally.
34+
35+
## 3. Check runner-image compatibility
36+
37+
Before changing any pin, check https://github.com/actions/runner-images:
38+
39+
- The README's Available Images table has the valid `runs-on` labels, including preview images (e.g. `xcode-27`) and deprecation notices.
40+
- Each macOS image readme (`images/macos/<image>-arm64-Readme.md`) lists installed Xcode versions, iOS simulator runtimes, and device types.
41+
42+
The chosen combination must exist together on one image: `runs-on` label ↔ `XCODE_VERSION` ↔ `DESTINATION` OS + device ↔ `simctl boot` device name. New Xcode majors appear first on a dedicated preview image before reaching the GA `macos-NN` image.
43+
44+
## 4. Reproduce and fix
45+
46+
- Do **not** run `xcodebuild` locally to reproduce — builds take too long (repo rule). Reproduce only cheap failures (SwiftLint, YAML, shell steps); for compile/SDK failures, reason from the logs plus the SDK check above.
47+
- Apply the fix to every workflow sharing the stale value.
48+
- Validate edited YAML: `ruby -ryaml -e 'YAML.load_file(".github/workflows/xcode.yml")'`
49+
- If you reproduced a failure locally, verify the fix locally before committing. Otherwise say plainly that verification needs a CI run; after pushing, watch it with `gh pr checks --watch` or `gh run watch`.

‎.github/workflows/additional-targets.yml‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
14
name: Build additional targets
25

36
on:
@@ -18,17 +21,20 @@ concurrency:
1821
jobs:
1922
build-and-test:
2023
name: Build and Test
21-
runs-on: macos-14
24+
runs-on: xcode-27
2225
if: github.event.pull_request.draft == false
2326
env:
2427
PROJECT: Nextcloud.xcodeproj
25-
DESTINATION: platform=iOS Simulator,name=iPhone 15
28+
DESTINATION: platform=iOS Simulator,name=iPhone 17,OS=27.0
29+
XCODE_VERSION: '27.0'
2630
steps:
27-
- name: Set env var
28-
run: echo "DEVELOPER_DIR=$(xcode-select --print-path)" >> $GITHUB_ENV
29-
- uses: actions/checkout@v4
31+
- uses: actions/checkout@v7
3032
- name: Download GoogleService-Info.plist
3133
run: wget "https://raw.githubusercontent.com/firebase/quickstart-ios/master/mock-GoogleService-Info.plist" -O GoogleService-Info.plist
34+
- name: Setup Xcode
35+
uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1.7.0
36+
with:
37+
xcode-version: ${{ env.XCODE_VERSION }}
3238
- name: Build iOS Share
3339
run: |
3440
xcodebuild build -project $PROJECT -scheme "$SCHEME" -destination "$DESTINATION" | xcbeautify --quieter

‎.github/workflows/lint.yml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
14

25
# Lints the project using SwiftLint
36

@@ -24,7 +27,7 @@ jobs:
2427
if: github.event.pull_request.draft == false
2528

2629
steps:
27-
- uses: actions/checkout@v4
30+
- uses: actions/checkout@v7
2831

2932
- name: GitHub Action for SwiftLint
3033
uses: norio-nomura/action-swiftlint@3.2.1

‎.github/workflows/reuse.yml‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# This workflow is provided via the organization template repository
2+
#
3+
# https://github.com/nextcloud/.github
4+
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
6+
# SPDX-FileCopyrightText: 2022 Free Software Foundation Europe e.V. <https://fsfe.org>
7+
#
8+
# SPDX-License-Identifier: CC0-1.0
9+
10+
name: REUSE Compliance Check
11+
12+
on: [pull_request]
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
reuse-compliance-check:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
23+
with:
24+
persist-credentials: false
25+
26+
- name: REUSE Compliance Check
27+
uses: fsfe/reuse-action@676e2d560c9a403aa252096d99fcab3e1132b0f5 # v6.0.0

‎.github/workflows/xcode.yml‎

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
14
name: Build and test main target
25

36
on:
@@ -17,26 +20,26 @@ on:
1720

1821
env:
1922
PROJECT: Nextcloud.xcodeproj
20-
DESTINATION: platform=iOS Simulator,name=iPhone 16,OS=18.5
23+
DESTINATION: platform=iOS Simulator,name=iPhone 17,OS=27.0
2124
SCHEME: Nextcloud
22-
XCODE_VERSION: '26.0.1'
25+
XCODE_VERSION: '27.0'
2326
SERVER_BRANCH: stable30
2427
PHP_VERSION: 8.3
2528

2629
jobs:
2730
build:
2831
name: Build
29-
runs-on: macos-15
32+
runs-on: xcode-27
3033
if: github.event.pull_request.draft == false
3134

3235
steps:
33-
- uses: actions/checkout@v5
36+
- uses: actions/checkout@v7
3437

3538
- name: Download GoogleService-Info.plist
3639
run: wget "https://raw.githubusercontent.com/firebase/quickstart-ios/master/mock-GoogleService-Info.plist" -O GoogleService-Info.plist
3740

3841
- name: Setup Xcode
39-
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
42+
uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1.7.0
4043
with:
4144
xcode-version: ${{ env.XCODE_VERSION }}
4245

@@ -50,24 +53,24 @@ jobs:
5053
| xcbeautify --quieter
5154
5255
- name: Upload Build Products
53-
uses: actions/upload-artifact@v4
56+
uses: actions/upload-artifact@v7
5457
with:
5558
name: Nextcloud for iOS
5659
path: DerivedData/Build/Products
5760
retention-days: 4
5861

5962
test:
6063
name: Run Tests
61-
runs-on: macos-15
64+
runs-on: xcode-27
6265
needs: [build]
6366

6467
if: github.event.pull_request.draft == false
6568

6669
steps:
67-
- uses: actions/checkout@v4
70+
- uses: actions/checkout@v7
6871

6972
- name: Setup Xcode
70-
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
73+
uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1.7.0
7174
with:
7275
xcode-version: ${{ env.XCODE_VERSION }}
7376

@@ -82,15 +85,15 @@ jobs:
8285
ini-values: apc.enable_cli=on, disable_functions=
8386

8487
- name: Checkout Nextcloud Server
85-
uses: actions/checkout@v4
88+
uses: actions/checkout@v7
8689
with:
8790
submodules: true
8891
repository: nextcloud/server
8992
path: server
9093
ref: ${{ env.SERVER_BRANCH }}
9194

9295
- name: Checkout Download Limits App
93-
uses: actions/checkout@v4
96+
uses: actions/checkout@v7
9497
with:
9598
repository: nextcloud/files_downloadlimit
9699
path: server/apps/files_downloadlimit
@@ -103,14 +106,12 @@ jobs:
103106
./server/occ config:system:set hashing_default_password --value=true --type=boolean
104107
./server/occ config:system:set auth.bruteforce.protection.enabled --value false --type bool
105108
./server/occ config:system:set ratelimit.protection.enabled --value false --type bool
106-
./server/occ config:system:set memcache.local --value="\\OC\\Memcache\\APCu"
107-
./server/occ config:system:set memcache.distributed --value="\\OC\\Memcache\\APCu"
108109
./server/occ app:enable files_downloadlimit
109110
./server/occ background:cron
110111
PHP_CLI_SERVER_WORKERS=5 php -S localhost:8080 -t server/ &
111112
112113
- name: Download Build
113-
uses: actions/download-artifact@v4
114+
uses: actions/download-artifact@v8
114115
with:
115116
name: Nextcloud for iOS
116117

@@ -119,8 +120,8 @@ jobs:
119120

120121
- name: Boot iOS Simulator
121122
run: |
122-
xcrun simctl boot "iPhone 16"
123-
xcrun simctl bootstatus "iPhone 16" || echo "Simulator booted"
123+
xcrun simctl boot "iPhone 17"
124+
xcrun simctl bootstatus "iPhone 17" || echo "Simulator booted"
124125
125126
- name: Check if Safari is installed
126127
run: |
@@ -143,7 +144,7 @@ jobs:
143144
-resultBundlePath "TestResult.xcresult"
144145
145146
- name: Upload Xcode Test Results
146-
uses: actions/upload-artifact@v4
147+
uses: actions/upload-artifact@v7
147148
if: ${{ !cancelled() }}
148149
with:
149150
name: TestResult.xcresult

‎.gitignore‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,9 @@ DerivedData
3535
*.hmap
3636
*.xccheckout
3737

38-
## Package
39-
Carthage/
40-
4138
### SwiftPackageManager ###
4239
.swiftpm
43-
Package.resolved
40+
Nextcloud.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
4441

45-
*.generated.swift
46-
/.env-vars
42+
## Claude Code
43+
.claude/

‎.swiftlint.yml‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
14
opt_in_rules: # some rules are turned off by default, so you need to opt-in
25
- empty_collection_literal
36
- empty_string
@@ -10,7 +13,7 @@ line_length:
1013
error: 5000
1114

1215
function_body_length:
13-
warning: 400
16+
warning: 500
1417

1518
type_body_length:
1619
warning: 2000
@@ -45,7 +48,7 @@ excluded:
4548
- Tests
4649
- Brand/NCBrand.swift
4750
- iOSClient/NCGlobal.swift
48-
- iOSClient/Utility/NCLivePhoto.swift
4951
- DerivedData
52+
- .claude
5053

5154
reporter: "xcode"

0 commit comments

Comments
 (0)