Skip to content

chore: Migrate chatcontroller to swift #744

chore: Migrate chatcontroller to swift

chore: Migrate chatcontroller to swift #744

Workflow file for this run

# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT
name: Build main target
on:
pull_request:
paths:
- '.github/workflows/**'
- Podfile
- NextcloudTalk.xcodeproj/**
- NextcloudTalk/**
- NextcloudTalkTests/**
- NotificationServiceExtension/**
- ShareExtension/**
- BroadcastUploadExtension/**
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 16,OS=18.5
SIMULATOR_MODEL: iPhone 16
SIMULATOR_VERSION: "18.5"
SCHEME: NextcloudTalk
XCODE_VERSION: "26.2"
jobs:
build:
name: Build
runs-on: macos-15
steps:
# Workaround for eliminating iOS 17 simulators stalling issue
# Runs deamon which kills CPU intensive tasks which affects simulator performance
# See https://github.com/actions/runner-images/issues/11509#issuecomment-2703308482
- name: Install and run yeetd
run: |
wget https://github.com/biscuitehh/yeetd/releases/download/1.0/yeetd-normal.pkg
sudo installer -pkg yeetd-normal.pkg -target /
defaults write dev.biscuit.yeetd killapsd true
yeetd &
- name: Checkout app
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
submodules: true
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Setup Cocoapods
uses: maxim-lobanov/setup-cocoapods@8e97e1e98e6ccf42564fdf5622c8feec74199377 # v1.4.0
with:
version: latest
- name: Set up dependencies talk-ios
run: |
pod install
- name: Setup Xcode ${{ env.XCODE_VERSION }}
uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1.7.0
with:
xcode-version: ${{ env.XCODE_VERSION }}
- name: Install iOS ${{ env.SIMULATOR_VERSION }}
run: |
xcrun simctl list > /dev/null # Required to prevent the next command from sometimes not working
xcodebuild -downloadPlatform iOS -buildVersion ${{ env.SIMULATOR_VERSION }}
- 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@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: Products
path: DerivedData/Build/Products
retention-days: 4
test:
name: Test
runs-on: macos-15
needs: [build]
strategy:
fail-fast: false
matrix:
# Test with stable23 as well to find regressions in older versions
configs: [
{
serverbranch: 'stable23',
talkbranch: 'stable23',
notificationsbranch: 'stable23',
phpversion: '8.0'
},
{
serverbranch: 'stable32',
talkbranch: 'stable32',
notificationsbranch: 'stable32',
phpversion: '8.3'
},
{
serverbranch: 'stable33',
talkbranch: 'stable33',
notificationsbranch: 'stable33',
phpversion: '8.3'
},
{
serverbranch: 'stable34',
talkbranch: 'stable34',
notificationsbranch: 'stable34',
phpversion: '8.3'
},
{
serverbranch: 'master',
talkbranch: 'main',
notificationsbranch: 'master',
phpversion: '8.3'
}
]
steps:
# Workaround for eliminating iOS 17 simulators stalling issue
# Runs deamon which kills CPU intensive tasks which affects simulator performance
# See https://github.com/actions/runner-images/issues/11509#issuecomment-2703308482
- name: Install and run yeetd
run: |
wget https://github.com/biscuitehh/yeetd/releases/download/1.0/yeetd-normal.pkg
sudo installer -pkg yeetd-normal.pkg -target /
defaults write dev.biscuit.yeetd killapsd true
yeetd &
- name: Checkout app
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
submodules: true
- name: Set up php ${{ matrix.configs.phpversion }}
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2
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:
fail-fast: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout server
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
submodules: true
repository: nextcloud/server
path: server
ref: ${{ matrix.configs.serverbranch }}
- name: Checkout Talk
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
repository: nextcloud/spreed
path: server/apps/spreed
ref: ${{ matrix.configs.talkbranch }}
- name: Checkout notifications app
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
repository: nextcloud/notifications
path: server/apps/notifications
ref: ${{ matrix.configs.notificationsbranch }}
- name: Set up production dependencies spreed
working-directory: server/apps/spreed
run: composer i --no-dev
- name: Set up production dependencies notifications
working-directory: server/apps/notifications
run: composer i --no-dev
- name: Set up Nextcloud
run: |
mkdir server/data
./server/occ maintenance:install --verbose --database=sqlite --admin-user admin --admin-pass admin --admin-email admin@local.invalid
./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 app:enable --force notifications
./server/occ background:cron
./server/occ talk:bot:install TestBot secret123456789123456789qwertzuiop1234567890 https://domain.invalid "New description" || true
OC_PASS=alice ./server/occ user:add --password-from-env alice
PHP_CLI_SERVER_WORKERS=10 php -S localhost:8080 -t server/ &
- name: Download test-build
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
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: Setup Xcode ${{ env.XCODE_VERSION }}
uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1.7.0
with:
xcode-version: ${{ env.XCODE_VERSION }}
- name: Install iOS ${{ env.SIMULATOR_VERSION }}
run: |
xcrun simctl list > /dev/null # Required to prevent the next command from sometimes not working
xcodebuild -downloadPlatform iOS -buildVersion ${{ env.SIMULATOR_VERSION }}
- name: Boot simulator
uses: futureware-tech/simulator-action@e89aa8f93d3aec35083ff49d2854d07f7186f7f5 # v5.0.0
with:
model: ${{ env.SIMULATOR_MODEL }}
os_version: ${{ env.SIMULATOR_VERSION }}
wait_for_boot: true
- name: Test NextcloudTalk iOS
run: |
xcrun simctl privacy booted grant camera com.nextcloud.Talk
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: Parse test results with xcresultparser & xctesthtmlreport
if: ${{ !cancelled() }}
run: |
brew install xcresultparser xctesthtmlreport
xcresultparser -o cli testResult.xcresult
xchtmlreport -i -z testResult.xcresult
mv index.html testResults-${{ matrix.configs.talkbranch }}.html
- name: Upload result page from xchtmlresult
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ !cancelled() }}
with:
path: 'testResults-${{ matrix.configs.talkbranch }}.html'
archive: false # This ignores the name parameter, therefore we rename in the create step
- name: Print logs
if: ${{ !cancelled() }}
run: |
cat server/data/nextcloud.log
- name: Upload test results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
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