12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- name: Build main target
- on:
- push:
- branches:
- - master
- - develop
- pull_request:
- types: [synchronize, opened, reopened, ready_for_review]
- branches:
- - master
- - develop
- jobs:
- build-and-test:
- name: Build and Test
- runs-on: macOS-latest
- if: github.event.pull_request.draft == false
- env:
- PROJECT: Nextcloud.xcodeproj
- DESTINATION: platform=iOS Simulator,name=iPhone 14
- SCHEME: Nextcloud
- steps:
- - name: Set env var
- run: echo "DEVELOPER_DIR=$(xcode-select --print-path)" >> $GITHUB_ENV
- - uses: actions/checkout@v3
- - name: Setup Bundler and Install Gems
- run: |
- gem install bundler
- bundle install
- bundle update
- - name: Restore Carhage Cache
- uses: actions/cache@v3
- id: carthage-cache
- with:
- path: Carthage
- key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }}
- restore-keys: |
- ${{ runner.os }}-carthage-
- - name: Carthage
- if: steps.carthage-cache.outputs.cache-hit != 'true'
- run: carthage bootstrap --use-xcframeworks --platform iOS
- - name: Download GoogleService-Info.plist
- run: wget "https://raw.githubusercontent.com/firebase/quickstart-ios/master/mock-GoogleService-Info.plist" -O GoogleService-Info.plist
- - name: Install docker
- run: |
- # Workaround for https://github.com/actions/runner-images/issues/8104
- brew remove --ignore-dependencies qemu
- curl -o ./qemu.rb https://raw.githubusercontent.com/Homebrew/homebrew-core/dc0669eca9479e9eeb495397ba3a7480aaa45c2e/Formula/qemu.rb
- brew install ./qemu.rb
- brew install docker
- colima start
- - name: Create docker test server and export enviroment variables
- run: |
- source ./create-docker-test-server.sh
- if [ ! -f ".env-vars" ]; then
- touch .env-vars
- echo "export TEST_SERVER_URL=$TEST_SERVER_URL" >> .env-vars
- echo "export TEST_USER=$TEST_USER" >> .env-vars
- echo "export TEST_APP_PASSWORD=$TEST_APP_PASSWORD" >> .env-vars
- fi
- - name: Build & Test Nextcloud iOS
- run: |
- set -o pipefail && xcodebuild test -project $PROJECT \
- -scheme "$SCHEME" \
- -destination "$DESTINATION" \
- -enableCodeCoverage YES \
- -test-iterations 3 \
- -retry-tests-on-failure \
- | xcpretty
- - name: Upload coverage to codecov
- run: |
- bundle exec slather
- bash <(curl -s https://codecov.io/bash) -f ./cobertura.xml -X coveragepy -X gcov -X xcode -t ${{ secrets.CODECOV_TOKEN }}
|