Merge pull request #2177 from selfxyz/staging #168
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: Native Shells CI | |
| permissions: | |
| contents: read | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, labeled] | |
| paths: | |
| - "packages/native-shell-android/**" | |
| - "packages/native-shell-ios/**" | |
| - ".github/workflows/native-shells-ci.yml" | |
| - ".github/actions/**" | |
| - ".github/CI_FORCE_RUN" | |
| push: | |
| branches: [dev, staging, main] | |
| paths: | |
| - "packages/native-shell-android/**" | |
| - "packages/native-shell-ios/**" | |
| - ".github/workflows/native-shells-ci.yml" | |
| - ".github/actions/**" | |
| - ".github/CI_FORCE_RUN" | |
| workflow_dispatch: {} | |
| jobs: | |
| changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| android: ${{ steps.filter.outputs.android }} | |
| ios: ${{ steps.filter.outputs.ios }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| android: | |
| - "packages/native-shell-android/**" | |
| - ".github/workflows/native-shells-ci.yml" | |
| - ".github/actions/**" | |
| - ".github/CI_FORCE_RUN" | |
| ios: | |
| - "packages/native-shell-ios/**" | |
| - ".github/workflows/native-shells-ci.yml" | |
| - ".github/actions/**" | |
| - ".github/CI_FORCE_RUN" | |
| native-shell-android-tests: | |
| needs: changes | |
| if: needs.changes.outputs.android == 'true' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| defaults: | |
| run: | |
| working-directory: packages/native-shell-android | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: "17" | |
| - uses: ./.github/actions/cache-gradle | |
| - uses: gradle/actions/setup-gradle@v4 | |
| with: | |
| cache-disabled: true | |
| - run: ./gradlew ktlintCheck | |
| - run: ./gradlew testDebugUnitTest | |
| - uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: native-shell-android-test-results | |
| path: | | |
| packages/native-shell-android/build/reports/tests/ | |
| packages/native-shell-android/build/test-results/ | |
| native-shell-ios-tests: | |
| needs: changes | |
| if: | | |
| needs.changes.outputs.ios == 'true' && | |
| (github.event_name == 'workflow_dispatch' || | |
| (github.event_name == 'push' && contains(fromJSON('["refs/heads/staging","refs/heads/main"]'), github.ref)) || | |
| (github.event_name == 'pull_request' && contains(fromJSON('["staging","main"]'), github.base_ref)) || | |
| (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'test-ios'))) | |
| runs-on: namespace-profile-apple-silicon-6cpu | |
| timeout-minutes: 30 | |
| defaults: | |
| run: | |
| working-directory: packages/native-shell-ios | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Find iOS Simulator | |
| id: sim | |
| uses: ./.github/actions/find-ios-simulator | |
| - name: Install SwiftLint | |
| run: brew install swiftlint | |
| - name: Run SwiftLint | |
| run: swiftlint lint --strict | |
| - name: Run Swift package tests | |
| run: | | |
| xcodebuild \ | |
| -scheme SelfNativeShell \ | |
| -destination "id=${{ steps.sim.outputs.id }}" \ | |
| -resultBundlePath TestResults.xcresult \ | |
| test | |
| - uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: native-shell-ios-test-results | |
| path: packages/native-shell-ios/TestResults.xcresult |