xcode.yml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. name: Build and test main target
  2. on:
  3. push:
  4. branches:
  5. - master
  6. - develop
  7. pull_request:
  8. types: [synchronize, opened, reopened, ready_for_review]
  9. branches:
  10. - master
  11. - develop
  12. env:
  13. PROJECT: Nextcloud.xcodeproj
  14. DESTINATION: platform=iOS Simulator,name=iPhone 16,OS=18.1
  15. SCHEME: Nextcloud
  16. SERVER_BRANCH: stable28
  17. PHP_VERSION: 8.2
  18. jobs:
  19. build:
  20. name: Build
  21. runs-on: macos-15
  22. if: github.event.pull_request.draft == false
  23. steps:
  24. - uses: actions/checkout@v4
  25. - name: Download GoogleService-Info.plist
  26. run: wget "https://raw.githubusercontent.com/firebase/quickstart-ios/master/mock-GoogleService-Info.plist" -O GoogleService-Info.plist
  27. - name: Build Nextcloud iOS
  28. run: |
  29. set -o pipefail && \
  30. xcodebuild build-for-testing \
  31. -scheme "${{ env.SCHEME }}" \
  32. -destination "${{ env.DESTINATION }}" \
  33. -derivedDataPath "DerivedData" \
  34. | xcbeautify --quieter
  35. - name: Upload test build
  36. uses: actions/upload-artifact@v4
  37. with:
  38. name: Nextcloud iOS
  39. path: DerivedData/Build/Products
  40. retention-days: 4
  41. test:
  42. name: Test
  43. runs-on: macos-15
  44. needs: [build]
  45. if: github.event.pull_request.draft == false
  46. steps:
  47. - uses: actions/checkout@v4
  48. - name: Set up php ${{ env.PHP_VERSION }}
  49. uses: shivammathur/setup-php@8872c784b04a1420e81191df5d64fbd59d3d3033 # v2.30.0
  50. with:
  51. php-version: ${{ env.PHP_VERSION }}
  52. # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
  53. 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
  54. coverage: none
  55. ini-file: development
  56. # Temporary workaround for missing pcntl_* in PHP 8.3: ini-values: apc.enable_cli=on
  57. ini-values: apc.enable_cli=on, disable_functions=
  58. - name: Checkout server
  59. uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
  60. with:
  61. submodules: true
  62. repository: nextcloud/server
  63. path: server
  64. ref: ${{ env.SERVER_BRANCH }}
  65. - name: Set up Nextcloud
  66. run: |
  67. mkdir server/data
  68. ./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
  69. ./server/occ config:system:set hashing_default_password --value=true --type=boolean
  70. ./server/occ config:system:set auth.bruteforce.protection.enabled --value false --type bool
  71. ./server/occ config:system:set ratelimit.protection.enabled --value false --type bool
  72. ./server/occ config:system:set memcache.local --value="\\OC\\Memcache\\APCu"
  73. ./server/occ config:system:set memcache.distributed --value="\\OC\\Memcache\\APCu"
  74. ./server/occ background:cron
  75. PHP_CLI_SERVER_WORKERS=5 php -S localhost:8080 -t server/ &
  76. - name: Download test build
  77. uses: actions/download-artifact@v4
  78. with:
  79. name: Nextcloud iOS
  80. - name: Check server status
  81. run: curl -s --retry 5 --retry-delay 60 --retry-all-errors http://localhost:8080/status.php || true
  82. - name: Test Nextcloud iOS
  83. run: |
  84. set -o pipefail && \
  85. xcodebuild test-without-building \
  86. -xctestrun $(find . -type f -name "*.xctestrun") \
  87. -destination "${{ env.DESTINATION }}" \
  88. -derivedDataPath "DerivedData" \
  89. -test-iterations 3 \
  90. -retry-tests-on-failure \
  91. -resultBundlePath "TestResult.xcresult" \
  92. | xcbeautify --quieter
  93. - name: Upload test results
  94. uses: actions/upload-artifact@v4
  95. if: ${{ !cancelled() }}
  96. with:
  97. name: TestResult.xcresult
  98. path: "TestResult.xcresult"