Skip to content

Commit

Permalink
test github action
Browse files Browse the repository at this point in the history
  • Loading branch information
kaytran2992 committed Sep 23, 2024
1 parent d07d56b commit 0b208ef
Show file tree
Hide file tree
Showing 2 changed files with 138 additions and 101 deletions.
202 changes: 101 additions & 101 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,101 +1,101 @@
version: 2.1
orbs:
gradle: circleci/[email protected]
android: circleci/[email protected]

jobs:
build-assemble:
executor:
name: android/android-machine
tag: 2023.11.1
resource-class: xlarge
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}
- run:
name: Set Up
command: |
./gradlew wrapper
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}
- run:
name: API Wrapper Sample Assemble builds
command: |
./gradlew wrappers-sample:assembleRelease
- run:
name: OCR Sample Assemble builds
command: |
./gradlew ocr-sample:assembleRelease
- run:
name: Auto Suggest Sample builds
command: |
./gradlew autosuggest-sample:assembleRelease
- run:
name: Auto Suggest Sample Voice builds
command: |
./gradlew autosuggest-sample-voice:assembleRelease
- run:
name: Multi Component Sample Assemble builds
command: |
./gradlew multi-component-sample:assembleRelease
- store_artifacts:
path: wrappers-sample/build/outputs/apk/release
- store_artifacts:
path: ocr-sample/build/outputs/apk/release
- store_artifacts:
path: autosuggest-sample/build/outputs/apk/release
- store_artifacts:
path: autosuggest-sample-voice/build/outputs/apk/release
- store_artifacts:
path: multi-component-sample/build/outputs/apk/release
build-ui-test:
executor:
name: android/android-machine
tag: 2023.11.1
resource-class: xlarge
steps:
- checkout
- run:
name: Config emulator
command: |
cp -rf multi-component-sample/src/androidTest/resources/custom.png /opt/android/sdk/emulator/resources
cp -rf multi-component-sample/src/androidTest/resources/Toren1BD.posters /opt/android/sdk/emulator/resources
- restore_cache:
key: jars-{{ checksum "build.gradle" }}
- android/create-avd:
avd-name: testDevice
system-image: system-images;android-34;google_apis_playstore;x86_64
install: true
- android/start-emulator:
avd-name: testDevice
no-window: true
camera-back: virtualscene
restore-gradle-cache-prefix: v1a
post-emulator-launch-assemble-command: echo "Emulator Started"
- run:
name: Set Up
command: |
./gradlew wrapper
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}
- android/run-tests:
test-command: ./gradlew multi-component-sample:jacocoTestReport
max-tries: 5
- store_test_results:
path: multi-component-sample/build/outputs/androidTest-results
- android/save-gradle-cache:
cache-prefix: v1a
workflows:
build-test:
jobs:
- build-assemble:
context:
- mobile
- build-ui-test:
context:
- mobile
#version: 2.1
#orbs:
# gradle: circleci/[email protected]
# android: circleci/[email protected]
#
#jobs:
# build-assemble:
# executor:
# name: android/android-machine
# tag: 2023.11.1
# resource-class: xlarge
# steps:
# - checkout
# - restore_cache:
# key: jars-{{ checksum "build.gradle" }}
# - run:
# name: Set Up
# command: |
# ./gradlew wrapper
# - save_cache:
# paths:
# - ~/.gradle
# key: jars-{{ checksum "build.gradle" }}
# - run:
# name: API Wrapper Sample Assemble builds
# command: |
# ./gradlew wrappers-sample:assembleRelease
# - run:
# name: OCR Sample Assemble builds
# command: |
# ./gradlew ocr-sample:assembleRelease
# - run:
# name: Auto Suggest Sample builds
# command: |
# ./gradlew autosuggest-sample:assembleRelease
# - run:
# name: Auto Suggest Sample Voice builds
# command: |
# ./gradlew autosuggest-sample-voice:assembleRelease
# - run:
# name: Multi Component Sample Assemble builds
# command: |
# ./gradlew multi-component-sample:assembleRelease
# - store_artifacts:
# path: wrappers-sample/build/outputs/apk/release
# - store_artifacts:
# path: ocr-sample/build/outputs/apk/release
# - store_artifacts:
# path: autosuggest-sample/build/outputs/apk/release
# - store_artifacts:
# path: autosuggest-sample-voice/build/outputs/apk/release
# - store_artifacts:
# path: multi-component-sample/build/outputs/apk/release
# build-ui-test:
# executor:
# name: android/android-machine
# tag: 2023.11.1
# resource-class: xlarge
# steps:
# - checkout
# - run:
# name: Config emulator
# command: |
# cp -rf multi-component-sample/src/androidTest/resources/custom.png /opt/android/sdk/emulator/resources
# cp -rf multi-component-sample/src/androidTest/resources/Toren1BD.posters /opt/android/sdk/emulator/resources
# - restore_cache:
# key: jars-{{ checksum "build.gradle" }}
# - android/create-avd:
# avd-name: testDevice
# system-image: system-images;android-34;google_apis_playstore;x86_64
# install: true
# - android/start-emulator:
# avd-name: testDevice
# no-window: true
# camera-back: virtualscene
# restore-gradle-cache-prefix: v1a
# post-emulator-launch-assemble-command: echo "Emulator Started"
# - run:
# name: Set Up
# command: |
# ./gradlew wrapper
# - save_cache:
# paths:
# - ~/.gradle
# key: jars-{{ checksum "build.gradle" }}
# - android/run-tests:
# test-command: ./gradlew multi-component-sample:jacocoTestReport
# max-tries: 5
# - store_test_results:
# path: multi-component-sample/build/outputs/androidTest-results
# - android/save-gradle-cache:
# cache-prefix: v1a
#workflows:
# build-test:
# jobs:
# - build-assemble:
# context:
# - mobile
# - build-ui-test:
# context:
# - mobile
37 changes: 37 additions & 0 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build Test

on:
push:
branches:
- 'task/**'

jobs:
build-test:
runs-on: Standard GitHub-hosted runners

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Java 17
uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'

- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Chmod permissions
run: sudo chmod +x ./gradlew

- name: Setup Gradle Cache
uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true
cache-read-only: false

# Run instrumentation tests here

- name: API Wrapper Sample Assemble builds
run: ./gradlew wrappers-sample:assembleRelease

0 comments on commit 0b208ef

Please sign in to comment.