Skip to content

Ensure non-nil sessionId #781

Ensure non-nil sessionId

Ensure non-nil sessionId #781

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/**
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.3' },
{ talkbranch: 'stable29', serverbranch: 'stable29', phpversion: '8.3' },
{ talkbranch: 'stable30', serverbranch: 'stable30', phpversion: '8.3' },
{ talkbranch: 'main', serverbranch: 'master', phpversion: '8.3' }
]
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