Add noInternetConnection error mapping to all cloud providers, run Sw… #774
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build | |
| on: | |
| push: | |
| pull_request_target: | |
| types: [labeled] | |
| jobs: | |
| build: | |
| name: Build and test | |
| runs-on: [self-hosted, macOS, ARM64] | |
| env: | |
| DERIVED_DATA_PATH: 'DerivedData' | |
| DEVICE: 'iPhone 17 Pro' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| # Disable shallow clone for SonarCloud analysis | |
| # https://docs.sonarsource.com/sonarqube-cloud/advanced-setup/ci-based-analysis/github-actions-for-sonarcloud | |
| fetch-depth: 0 | |
| - uses: actions/cache@v4 | |
| with: | |
| path: .build | |
| key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} | |
| restore-keys: | | |
| ${{ runner.os }}-spm- | |
| - name: Run process.sh script | |
| run: | | |
| ./Scripts/process.sh | |
| exit $? | |
| - name: Build | |
| run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild clean build-for-testing -scheme 'CryptomatorCloudAccess' -destination "name=$DEVICE" -derivedDataPath $DERIVED_DATA_PATH -enableCodeCoverage YES | xcbeautify | |
| - name: Test | |
| run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild test-without-building -xctestrun $(find . -type f -name "*.xctestrun") -destination "name=$DEVICE" -derivedDataPath $DERIVED_DATA_PATH | xcbeautify | |
| - name: Generate coverage report | |
| run: | | |
| xcresult_path=$(find $DERIVED_DATA_PATH/Logs/Test -name "*.xcresult" | head -n 1) | |
| bash Scripts/xccov-to-sonarqube-generic.sh "$xcresult_path" > sonarqube-generic-coverage.xml | |
| - name: SonarCloud Scan | |
| uses: SonarSource/sonarqube-scan-action@v6.0.0 | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| continue-on-error: true | |
| integration-tests: | |
| name: Run integration tests for ${{ matrix.name }} | |
| runs-on: [self-hosted, macOS, ARM64] | |
| needs: build | |
| if: startsWith(github.ref, 'refs/tags/') | |
| env: | |
| DERIVED_DATA_PATH: 'DerivedData' | |
| DEVICE: 'iPhone 17 Pro' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: Box | |
| scheme-name: BoxIntegrationTests | |
| - name: Common | |
| scheme-name: CommonIntegrationTests | |
| - name: Dropbox | |
| scheme-name: DropboxIntegrationTests | |
| - name: Google Drive | |
| scheme-name: GoogleDriveIntegrationTests | |
| - name: Local File System | |
| scheme-name: LocalFileSystemIntegrationTests | |
| - name: Microsoft Graph | |
| scheme-name: MicrosoftGraphIntegrationTests | |
| - name: pCloud | |
| scheme-name: PCloudIntegrationTests | |
| - name: S3 | |
| scheme-name: S3IntegrationTests | |
| - name: WebDAV | |
| scheme-name: WebDAVIntegrationTests | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/cache@v4 | |
| with: | |
| path: .build | |
| key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} | |
| restore-keys: | | |
| ${{ runner.os }}-spm- | |
| - name: Run integration tests | |
| run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -scheme '${{ matrix.scheme-name }}' -destination "name=$DEVICE" -derivedDataPath $DERIVED_DATA_PATH test | xcbeautify | |
| env: | |
| BOX_CLIENT_ID: ${{ secrets.BOX_CLIENT_ID }} | |
| BOX_CLIENT_SECRET: ${{ secrets.BOX_CLIENT_SECRET }} | |
| BOX_ENTERPRISE_ID: ${{ secrets.BOX_ENTERPRISE_ID }} | |
| DROPBOX_ACCESS_TOKEN: ${{ secrets.DROPBOX_ACCESS_TOKEN }} | |
| GOOGLE_DRIVE_CLIENT_ID: ${{ secrets.GOOGLE_DRIVE_CLIENT_ID }} | |
| GOOGLE_DRIVE_REFRESH_TOKEN: ${{ secrets.GOOGLE_DRIVE_REFRESH_TOKEN }} | |
| MICROSOFT_GRAPH_CLIENT_ID: ${{ secrets.MICROSOFT_GRAPH_CLIENT_ID }} | |
| MICROSOFT_GRAPH_REDIRECT_URI_SCHEME: ${{ secrets.MICROSOFT_GRAPH_REDIRECT_URI_SCHEME }} | |
| MICROSOFT_GRAPH_REFRESH_TOKEN: ${{ secrets.MICROSOFT_GRAPH_REFRESH_TOKEN }} | |
| PCLOUD_APP_KEY: ${{ secrets.PCLOUD_APP_KEY }} | |
| PCLOUD_ACCESS_TOKEN: ${{ secrets.PCLOUD_ACCESS_TOKEN }} | |
| PCLOUD_HTTP_API_HOST_NAME: ${{ secrets.PCLOUD_HTTP_API_HOST_NAME }} | |
| S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} | |
| S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }} | |
| S3_URL: ${{ secrets.S3_URL }} | |
| S3_BUCKET: ${{ secrets.S3_BUCKET }} | |
| S3_REGION: ${{ secrets.S3_REGION }} | |
| WEBDAV_BASE_URL: ${{ secrets.WEBDAV_BASE_URL }} | |
| WEBDAV_USERNAME: ${{ secrets.WEBDAV_USERNAME }} | |
| WEBDAV_PASSWORD: ${{ secrets.WEBDAV_PASSWORD }} | |
| release: | |
| name: Deploy and draft a release | |
| runs-on: macos-latest | |
| needs: build | |
| if: startsWith(github.ref, 'refs/tags/') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Draft release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref }} | |
| release_name: ${{ github.ref }} | |
| body: | | |
| :construction: Work in Progress | |
| draft: true | |
| prerelease: false |