xcode.yml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. name: Build 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. jobs:
  13. build-and-test:
  14. name: Build and Test
  15. runs-on: macOS-latest
  16. if: github.event.pull_request.draft == false
  17. env:
  18. PROJECT: Nextcloud.xcodeproj
  19. DESTINATION: platform=iOS Simulator,name=iPhone 14
  20. SCHEME: Nextcloud
  21. steps:
  22. - name: Set env var
  23. run: echo "DEVELOPER_DIR=$(xcode-select --print-path)" >> $GITHUB_ENV
  24. - uses: actions/checkout@v3
  25. - name: Setup Bundler and Install Gems
  26. run: |
  27. gem install bundler
  28. bundle install
  29. bundle update
  30. - name: Restore Carhage Cache
  31. uses: actions/cache@v3
  32. id: carthage-cache
  33. with:
  34. path: Carthage
  35. key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }}
  36. restore-keys: |
  37. ${{ runner.os }}-carthage-
  38. - name: Carthage
  39. if: steps.carthage-cache.outputs.cache-hit != 'true'
  40. run: carthage bootstrap --use-xcframeworks --platform iOS
  41. - name: Download GoogleService-Info.plist
  42. run: wget "https://raw.githubusercontent.com/firebase/quickstart-ios/master/mock-GoogleService-Info.plist" -O GoogleService-Info.plist
  43. - name: Install docker
  44. run: |
  45. brew install docker
  46. colima start
  47. - name: Create docker test server and export enviroment variables
  48. run: |
  49. source ./create-docker-test-server.sh
  50. if [ ! -f ".env-vars" ]; then
  51. touch .env-vars
  52. echo "export TEST_SERVER_URL=$TEST_SERVER_URL" >> .env-vars
  53. echo "export TEST_USER=$TEST_USER" >> .env-vars
  54. echo "export TEST_APP_PASSWORD=$TEST_APP_PASSWORD" >> .env-vars
  55. fi
  56. - name: Build & Test Nextcloud iOS
  57. run: |
  58. set -o pipefail && xcodebuild test -project $PROJECT \
  59. -scheme "$SCHEME" \
  60. -destination "$DESTINATION" \
  61. -enableCodeCoverage YES \
  62. -test-iterations 3 \
  63. -retry-tests-on-failure \
  64. | xcpretty
  65. - name: Upload coverage to codecov
  66. run: |
  67. bundle exec slather
  68. bash <(curl -s https://codecov.io/bash) -f ./cobertura.xml -X coveragepy -X gcov -X xcode -t ${{ secrets.CODECOV_TOKEN }}