TASK-1828883: few minor review fixes #478
Workflow file for this run
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: "Perform build and checks" | |
| on: | |
| push | |
| jobs: | |
| validate-android: | |
| runs-on: 'ubuntu-latest' | |
| env: | |
| GRADLE: ./gradlew -Dorg.gradle.console=plain --no-daemon | |
| EMULATOR_IMAGE: 'system-images;android-35;google_apis;x86_64' | |
| steps: | |
| - name: Enable KVM | |
| run: | | |
| echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
| sudo udevadm control --reload-rules | |
| sudo udevadm trigger --name-match=kvm | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '17' | |
| distribution: 'corretto' | |
| - name: Set up cache for CDN files | |
| id: cdn-cache-android | |
| uses: actions/cache@v4 | |
| with: | |
| path: test/src/commonMain/composeResources/files/responses/cdn | |
| key: cdn-cache-${{ hashFiles('test/src/commonMain/composeResources/files/responses/download_js_files.sh') }} | |
| - name: Download CDN files | |
| if: steps.cdn-cache-android.outputs.cache-hit != 'true' | |
| run: cd test/src/commonMain/composeResources/files/responses && ./download_js_files.sh | |
| - name: Set up cache for Gradle | |
| id: cache-gradle | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.gradle | |
| key: gradle-cache-android-check | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| with: | |
| cmdline-tools-version: 12266719 | |
| packages: '${{ env.EMULATOR_IMAGE }} platforms;android-35 platform-tools emulator' | |
| log-accepted-android-sdk-licenses: false | |
| - name: Run tests | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: 35 | |
| arch: x86_64 | |
| profile: Nexus 6 | |
| enable-hw-keyboard: false | |
| disable-spellchecker: true | |
| script: $GRADLE clean :test:connectedAndroidTest :samples:android-cmp-app:connectedAndroidTest | |
| - name: Upload test artifacts for failures | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: validate-android-artifacts | |
| path: | | |
| test/build/reports/ | |
| samples/android-cmp-app/build/reports/ | |
| if-no-files-found: warn | |
| retention-days: 3 | |
| validate-ios: | |
| runs-on: 'macos-15' | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '17' | |
| distribution: 'corretto' | |
| - name: Set up cache for CDN files | |
| id: cdn-cache-ios | |
| uses: actions/cache@v4 | |
| with: | |
| path: test/src/commonMain/composeResources/files/responses/cdn | |
| key: cdn-cache-${{ hashFiles('test/src/commonMain/composeResources/files/responses/download_js_files.sh') }} | |
| - name: Download CDN files | |
| if: steps.cdn-cache-ios.outputs.cache-hit != 'true' | |
| run: cd test/src/commonMain/composeResources/files/responses && ./download_js_files.sh | |
| - name: Set up cache for Gradle | |
| id: cache-gradle | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.gradle | |
| key: gradle-cache-ios-check | |
| - name: Select specific XCode version | |
| run: sudo xcode-select -s "/Applications/Xcode_16.4.app" | |
| - name: Create new test simulator | |
| run: | | |
| xcodebuild -version | |
| echo "Listing available devices / iOSes:" | |
| xcrun simctl list | |
| echo "Deleting simulator SDKTestSimulator (if exists)" | |
| xcrun simctl delete SDKTestSimulator || true | |
| echo "Creating new SDKTestSimulator" | |
| xcrun simctl create SDKTestSimulator com.apple.CoreSimulator.SimDeviceType.iPhone-16 com.apple.CoreSimulator.SimRuntime.iOS-18-5 | tee simulator.id | |
| - name: iOS sample application UI tests | |
| run: | | |
| set -o pipefail | |
| rm -rf build || true | |
| mkdir build | |
| xcodebuild \ | |
| -project samples/swiftui-components-app/UITest/UITest.xcodeproj \ | |
| -scheme UITest \ | |
| -destination "platform=iOS Simulator,id=$(cat simulator.id)" \ | |
| -resultBundlePath ./build/iOSTests.xcresult \ | |
| -retry-tests-on-failure \ | |
| -test-iterations 2 \ | |
| -parallel-testing-enabled NO \ | |
| test 2>&1 | xcpretty && exit ${PIPESTATUS[0]} | |
| - name: Upload test artifacts for failures | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: validate-ios-artifacts | |
| path: build | |
| if-no-files-found: warn | |
| retention-days: 3 | |
| - name: Delete test simulator | |
| if: always() | |
| run: | | |
| echo "Deleting simulator SDKTestSimulator (if exists)" | |
| xcrun simctl delete SDKTestSimulator || true | |