ci: per-app build matrix with precise path triggers #3
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: Android example apps build check | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| workflow_dispatch: | |
| jobs: | |
| detect-changes: | |
| if: github.repository == 'software-mansion/react-native-executorch' && github.event.pull_request.draft != true | |
| runs-on: ubuntu-latest | |
| outputs: | |
| apps: ${{ steps.matrix.outputs.apps }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Detect changed apps | |
| id: filter | |
| if: github.event_name != 'workflow_dispatch' | |
| uses: dorny/paths-filter@v3 | |
| with: | |
| filters: | | |
| shared: &shared | |
| - .github/workflows/build-android.yml | |
| - .github/actions/build-android-app/** | |
| - packages/react-native-executorch/{android,scripts,third-party}/** | |
| - packages/react-native-executorch/{package.json,tsconfig.json} | |
| - packages/react-native-executorch/common/{ada,runner}/** | |
| - packages/react-native-executorch/common/rnexecutorch/{Error,ErrorCodes,Log}.h | |
| - packages/react-native-executorch/common/rnexecutorch/RnExecutorchInstaller.{cpp,h} | |
| - packages/react-native-executorch/common/rnexecutorch/{data_processing,host_objects,jsi,metaprogramming,tests,threads,utils}/** | |
| - packages/react-native-executorch/common/rnexecutorch/models/BaseModel.{cpp,h} | |
| - packages/react-native-executorch/src/{common,constants,errors,native,types,utils}/** | |
| - packages/react-native-executorch/src/index.ts | |
| - packages/react-native-executorch/src/modules/{BaseModule.ts,general/**} | |
| - packages/react-native-executorch/src/hooks/{general/**,useModule.ts,useModuleFactory.ts} | |
| - "{package.json,yarn.lock}" | |
| expo-shared: &expo-shared | |
| - *shared | |
| - packages/expo-resource-fetcher/** | |
| llm-pkg: &llm-pkg | |
| - packages/react-native-executorch/common/rnexecutorch/TokenizerModule.{cpp,h} | |
| - packages/react-native-executorch/common/rnexecutorch/models/llm/** | |
| - packages/react-native-executorch/src/modules/natural_language_processing/{LLMModule,TokenizerModule}.ts | |
| - packages/react-native-executorch/src/hooks/natural_language_processing/{useLLM,useTokenizer}.ts | |
| - packages/react-native-executorch/src/controllers/LLMController.ts | |
| llm: | |
| - *expo-shared | |
| - *llm-pkg | |
| - apps/llm/** | |
| computer-vision: | |
| - *expo-shared | |
| - packages/react-native-executorch/common/rnexecutorch/models/VisionModel.{cpp,h} | |
| - packages/react-native-executorch/common/rnexecutorch/models/{classification,instance_segmentation,object_detection,ocr,semantic_segmentation,style_transfer,text_to_image,vertical_ocr}/** | |
| - packages/react-native-executorch/src/{modules,hooks}/computer_vision/** | |
| - packages/react-native-executorch/src/controllers/{BaseOCRController,OCRController,VerticalOCRController}.ts | |
| - apps/computer-vision/** | |
| speech: | |
| - *expo-shared | |
| - packages/react-native-executorch/common/pfft/** | |
| - packages/react-native-executorch/common/rnexecutorch/TokenizerModule.{cpp,h} | |
| - packages/react-native-executorch/common/rnexecutorch/models/{speech_to_text,text_to_speech,voice_activity_detection}/** | |
| - packages/react-native-executorch/src/modules/natural_language_processing/{SpeechToTextModule,TextToSpeechModule,VADModule,TokenizerModule}.ts | |
| - packages/react-native-executorch/src/hooks/natural_language_processing/{useSpeechToText,useTextToSpeech,useVAD,useTokenizer}.ts | |
| - apps/speech/** | |
| text-embeddings: | |
| - *expo-shared | |
| - packages/react-native-executorch/common/rnexecutorch/TokenizerModule.{cpp,h} | |
| - packages/react-native-executorch/common/rnexecutorch/models/embeddings/** | |
| - packages/react-native-executorch/src/modules/natural_language_processing/{TextEmbeddingsModule,TokenizerModule}.ts | |
| - packages/react-native-executorch/src/modules/computer_vision/ImageEmbeddingsModule.ts | |
| - packages/react-native-executorch/src/hooks/natural_language_processing/{useTextEmbeddings,useTokenizer}.ts | |
| - packages/react-native-executorch/src/hooks/computer_vision/useImageEmbeddings.ts | |
| - apps/text-embeddings/** | |
| bare-rn: | |
| - *shared | |
| - *llm-pkg | |
| - packages/bare-resource-fetcher/** | |
| - apps/bare-rn/** | |
| - name: Compute matrix | |
| id: matrix | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| echo 'apps=["llm","computer-vision","speech","text-embeddings","bare-rn"]' >> "$GITHUB_OUTPUT" | |
| else | |
| echo "apps=${{ steps.filter.outputs.changes }}" >> "$GITHUB_OUTPUT" | |
| fi | |
| build: | |
| needs: detect-changes | |
| if: needs.detect-changes.outputs.apps != '[]' && needs.detect-changes.outputs.apps != '' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| app: ${{ fromJSON(needs.detect-changes.outputs.apps) }} | |
| concurrency: | |
| group: android-${{ matrix.app }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Build Android app | |
| uses: ./.github/actions/build-android-app | |
| with: | |
| app-path: apps/${{ matrix.app }} | |
| expo-prebuild: ${{ matrix.app == 'bare-rn' && 'false' || 'true' }} |