-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into snnn/up_header
- Loading branch information
Showing
5 changed files
with
249 additions
and
215 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ lintrunner-adapters==0.12.4 | |
# RUFF | ||
ruff==0.9.1 | ||
# CLANGFORMAT | ||
clang-format==19.1.6 | ||
clang-format==19.1.7 |
211 changes: 211 additions & 0 deletions
211
tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,211 @@ | ||
parameters: | ||
- name: PackageName | ||
displayName: 'Package name' | ||
type: string | ||
default: 'NPM_packages' | ||
|
||
- name: ArtifactName | ||
type: string | ||
default: 'onnxruntime-android-full-aar' | ||
|
||
- name: NpmPackagingMode | ||
displayName: 'NPM packages publish configuration' | ||
type: string | ||
default: 'dev' | ||
|
||
jobs: | ||
- job: ReactNative_CI_Android | ||
pool: 'onnxruntime-Ubuntu2204-AMD-CPU' | ||
variables: | ||
runCodesignValidationInjection: false | ||
timeoutInMinutes: 90 | ||
steps: | ||
- task: UsePythonVersion@0 | ||
displayName: Use python 3.12 | ||
inputs: | ||
versionSpec: "3.12" | ||
addToPath: true | ||
architecture: "x64" | ||
|
||
- task: JavaToolInstaller@0 | ||
displayName: Use jdk 17 | ||
inputs: | ||
versionSpec: '17' | ||
jdkArchitectureOption: 'x64' | ||
jdkSourceOption: 'PreInstalled' | ||
|
||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: '20.x' | ||
|
||
- script: | | ||
sudo apt install coreutils ninja-build nodejs npm yarn | ||
npm install --global yarn | ||
displayName: Install coreutils, ninja, npm, and yarn | ||
- task: DownloadPipelineArtifact@2 | ||
inputs: | ||
buildType: 'current' | ||
artifactName: '${{parameters.ArtifactName}}' | ||
targetPath: '$(Build.BinariesDirectory)/android-full-aar' | ||
displayName: Download Android AAR artifacts | ||
|
||
- task: CopyFiles@2 | ||
inputs: | ||
sourceFolder: $(Build.BinariesDirectory)/android-full-aar | ||
contents: onnxruntime-android-*.aar | ||
targetFolder: $(Build.SourcesDirectory)/js/react_native/android/libs | ||
displayName: Copy Android package to React Native directory | ||
|
||
- script: | | ||
npm ci | ||
workingDirectory: '$(Build.SourcesDirectory)/js' | ||
displayName: npm ci js | ||
- script: | | ||
npm ci | ||
workingDirectory: '$(Build.SourcesDirectory)/js/common' | ||
displayName: npm ci js/common | ||
- script: | | ||
yarn | ||
workingDirectory: '$(Build.SourcesDirectory)/js/react_native' | ||
displayName: yarn js/react_native | ||
- task: PowerShell@2 | ||
inputs: | ||
filePath: '$(Build.SourcesDirectory)/tools/ci_build/github/js/pack-npm-packages.ps1' | ||
arguments: '"-dev.$(Get-Date -Format yyyyMMdd)-$(git rev-parse --short HEAD)" $(Build.SourcesDirectory) react_native' | ||
workingDirectory: '$(Build.SourcesDirectory)' | ||
errorActionPreference: stop | ||
env: | ||
ORT_JS_PACK_MODE: e2e | ||
displayName: Pack NPM packages | ||
|
||
- script: | | ||
mv $(Build.SourcesDirectory)/js/common/onnxruntime-common*.tgz onnxruntime-common.tgz | ||
yarn add --no-lockfile file:./onnxruntime-common.tgz | ||
mv $(Build.SourcesDirectory)/js/react_native/onnxruntime-react-native*.tgz onnxruntime-react-native.tgz | ||
yarn add --no-lockfile file:./onnxruntime-react-native.tgz | ||
yarn | ||
workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e' | ||
displayName: Bootstrap Android and iOS e2e tests | ||
- script: | | ||
yarn add --dev jest-junit | ||
workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e' | ||
displayName: install jest junit reporter js/react_native/e2e | ||
- script: | | ||
keytool -genkey -v -keystore debug.keystore -alias androiddebugkey -storepass android \ | ||
-keypass android -keyalg RSA -keysize 2048 -validity 999999 -dname "CN=Android Debug,O=Android,C=US" | ||
workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e/android' | ||
displayName: Generate a debug keystore | ||
- task: CopyFiles@2 | ||
inputs: | ||
sourceFolder: $(Build.BinariesDirectory)/android-full-aar | ||
contents: onnxruntime-*.aar | ||
targetFolder: $(Build.SourcesDirectory)/js/react_native/e2e/android/app/libs | ||
displayName: Copy Android package to Android e2e test directory | ||
|
||
- script: | | ||
yarn global add detox-cli | ||
echo "Path: $PATH" | ||
echo "##vso[task.prependpath]$(yarn global bin)" | ||
echo "Updated PATH: $PATH" | ||
echo "Detox bin directory: $(yarn global bin)" | ||
ls $(yarn global bin) | ||
displayName: Install detox cli tools and prepend to PATH | ||
- script: | | ||
detox build --configuration android.emu.release | ||
workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e' | ||
displayName: Build React Native Detox Android e2e Tests | ||
# | ||
# Unit tests and E2E tests with Android emulator | ||
# | ||
- template: ../../templates/use-android-emulator.yml | ||
parameters: | ||
create: true | ||
start: true | ||
|
||
- template: ../../templates/android-dump-logs-from-steps.yml | ||
parameters: | ||
steps: | ||
- task: Gradle@3 | ||
inputs: | ||
gradleWrapperFile: '$(Build.SourcesDirectory)/js/react_native/android/gradlew' | ||
workingDirectory: '$(Build.SourcesDirectory)/js/react_native/android' | ||
options: '--stacktrace' | ||
tasks: 'connectedDebugAndroidTest' | ||
publishJUnitResults: true | ||
testResultsFiles: '**/TEST-*.xml' | ||
testRunTitle: 'React Native Android Instrumented Test results' | ||
sonarQubeRunAnalysis: false | ||
spotBugsAnalysis: false | ||
displayName: Run React Native Android Instrumented Tests | ||
|
||
- script: | | ||
JEST_JUNIT_OUTPUT_FILE=$(Build.SourcesDirectory)/js/react_native/e2e/android-test-results.xml \ | ||
detox test --record-logs all \ | ||
--configuration android.emu.release \ | ||
--loglevel trace \ | ||
--take-screenshots failing | ||
workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e' | ||
displayName: Run React Native Detox Android e2e Tests | ||
- template: ../../templates/use-android-emulator.yml | ||
parameters: | ||
stop: true | ||
|
||
- task: PublishTestResults@2 | ||
inputs: | ||
testResultsFiles: '$(Build.SourcesDirectory)/js/react_native/e2e/android-test-results.xml' | ||
failTaskOnFailedTests: true | ||
testRunTitle: 'React Native Detox Android e2e Test Results' | ||
condition: succeededOrFailed() | ||
displayName: Publish React Native Detox Android e2e Test Results | ||
|
||
- script: | | ||
git restore . | ||
workingDirectory: '$(Build.SourcesDirectory)/js' | ||
displayName: Restore git changes | ||
- task: PowerShell@2 | ||
inputs: | ||
filePath: '$(Build.SourcesDirectory)/tools/ci_build/github/js/pack-npm-packages.ps1' | ||
arguments: '"${{parameters.NpmPackagingMode}}" $(Build.SourcesDirectory) react_native' | ||
workingDirectory: '$(Build.SourcesDirectory)' | ||
errorActionPreference: stop | ||
displayName: Pack NPM packages | ||
|
||
- task: CopyFiles@2 | ||
inputs: | ||
sourceFolder: $(Build.SourcesDirectory)/js/common | ||
contents: onnxruntime-common*.tgz | ||
targetFolder: $(Build.ArtifactStagingDirectory) | ||
displayName: 'Create Artifacts onnxruntime-common' | ||
|
||
- task: CopyFiles@2 | ||
inputs: | ||
sourceFolder: $(Build.SourcesDirectory)/js/react_native | ||
contents: onnxruntime-react-native*.tgz | ||
targetFolder: $(Build.ArtifactStagingDirectory) | ||
displayName: Create Artifacts onnxruntime-react-native | ||
|
||
- task: PublishPipelineArtifact@1 | ||
inputs: | ||
artifact: android_e2e_test_logs_$(Build.BuildId)_$(Build.BuildNumber)_$(System.JobAttempt) | ||
targetPath: '$(Build.SourcesDirectory)/js/react_native/e2e/artifacts' | ||
condition: succeededOrFailed() | ||
displayName: Publish React Native Detox E2E test logs | ||
|
||
- task: PublishPipelineArtifact@0 | ||
inputs: | ||
artifactName: '${{parameters.PackageName}}' | ||
targetPath: '$(Build.ArtifactStagingDirectory)' | ||
displayName: Publish Pipeline Artifact | ||
|
||
- template: ../../templates/explicitly-defined-final-tasks.yml |
Oops, something went wrong.