[AI-FSSDK] prepare for release android-sdk v5.2.0 #455
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 CI | |
| on: | |
| push: | |
| branches: [ master ] | |
| tags: | |
| - '*' | |
| pull_request: | |
| branches: [ master ] | |
| workflow_dispatch: | |
| inputs: | |
| SNAPSHOT: | |
| type: boolean | |
| description: Set SNAPSHOT true to publish | |
| jobs: | |
| lint_markdown_files: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '2.6' | |
| bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
| - name: Install gem | |
| run: | | |
| gem install awesome_bot | |
| - name: Run tests | |
| run: find . -type f -name '*.md' -exec awesome_bot {} \; | |
| integration_tests: | |
| if: ${{ startsWith(github.ref, 'refs/tags/') != true && github.event.inputs.SNAPSHOT != 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| # You should create a personal access token and store it in your repository | |
| token: ${{ secrets.CI_USER_TOKEN }} | |
| repository: 'optimizely/ci-helper-tools' | |
| path: 'home/runner/ci-helper-tools' | |
| ref: 'master' | |
| - name: set SDK Branch if PR | |
| env: | |
| HEAD_REF: ${{ github.head_ref }} | |
| if: ${{ github.event_name == 'pull_request' }} | |
| run: | | |
| echo "SDK_BRANCH=$HEAD_REF" >> $GITHUB_ENV | |
| - name: set SDK Branch if not pull request | |
| env: | |
| REF_NAME: ${{github.ref_name}} | |
| if: ${{ github.event_name != 'pull_request' }} | |
| run: | | |
| echo "SDK_BRANCH=$REF_NAME" >> $GITHUB_ENV | |
| - name: Trigger build | |
| env: | |
| SDK: android | |
| FULLSTACK_TEST_REPO: ${{ inputs.FULLSTACK_TEST_REPO }} | |
| BUILD_NUMBER: ${{ github.run_id }} | |
| TESTAPP_BRANCH: master | |
| GITHUB_TOKEN: ${{ secrets.CI_USER_TOKEN }} | |
| EVENT_TYPE: ${{ github.event_name }} | |
| GITHUB_CONTEXT: ${{ toJson(github) }} | |
| #REPO_SLUG: ${{ github.repository }} | |
| PULL_REQUEST_SLUG: ${{ github.repository }} | |
| UPSTREAM_REPO: ${{ github.repository }} | |
| PULL_REQUEST_SHA: ${{ github.event.pull_request.head.sha }} | |
| PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }} | |
| UPSTREAM_SHA: ${{ github.sha }} | |
| EVENT_MESSAGE: ${{ github.event.message }} | |
| HOME: 'home/runner' | |
| run: | | |
| echo "$GITHUB_CONTEXT" | |
| home/runner/ci-helper-tools/trigger-script-with-status-update.sh | |
| build: | |
| uses: optimizely/android-sdk/.github/workflows/build.yml@master | |
| with: | |
| action: build | |
| test: | |
| if: ${{ startsWith(github.ref, 'refs/tags/') != true && github.event.inputs.SNAPSHOT != 'true' }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # API 21-26: not reliably supported by GitHub Actions (emulator boot failures observed on API 25) | |
| # API 29: removed due to emulator hang issues on GitHub-hosted runners | |
| # API 28 is the lowest level that boots consistently on GitHub-hosted runners | |
| include: | |
| - api-level: 28 | |
| arch: x86 | |
| target: google_apis | |
| - api-level: 33 | |
| arch: x86_64 | |
| target: google_apis | |
| - api-level: 36 | |
| arch: x86_64 | |
| target: google_apis | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v4 | |
| - name: set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - 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: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Gradle cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }} | |
| - name: AVD cache | |
| uses: actions/cache@v4 | |
| id: avd-cache | |
| with: | |
| path: | | |
| ~/.android/avd/* | |
| ~/.android/adb* | |
| ~/.android/debug.keystore | |
| key: avd-${{ matrix.api-level }}-${{ matrix.arch }}-${{ matrix.target }} | |
| - name: create AVD and generate snapshot for caching | |
| if: steps.avd-cache.outputs.cache-hit != 'true' | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: ${{ matrix.api-level }} | |
| arch: ${{ matrix.arch }} | |
| target: ${{ matrix.target }} | |
| force-avd-creation: false | |
| emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
| disable-animations: false | |
| script: echo "Generated AVD snapshot for caching." | |
| - name: run tests | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: ${{ matrix.api-level }} | |
| arch: ${{ matrix.arch }} | |
| target: ${{ matrix.target }} | |
| force-avd-creation: false | |
| emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
| disable-animations: true | |
| script: ./gradlew testAllModules | |
| publish: | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: optimizely/android-sdk/.github/workflows/build.yml@master | |
| with: | |
| action: ship | |
| github_tag: ${GITHUB_REF#refs/*/} | |
| secrets: | |
| MAVEN_SIGNING_KEY_BASE64: ${{ secrets.MAVEN_SIGNING_KEY_BASE64 }} | |
| MAVEN_SIGNING_PASSPHRASE: ${{ secrets.MAVEN_SIGNING_PASSPHRASE }} | |
| MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | |
| MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} | |
| snapshot: | |
| if: ${{ github.event.inputs.SNAPSHOT == 'true' && github.event_name == 'workflow_dispatch' }} | |
| uses: optimizely/android-sdk/.github/workflows/build.yml@master | |
| with: | |
| action: ship | |
| github_tag: BB-SNAPSHOT | |
| secrets: | |
| MAVEN_SIGNING_KEY_BASE64: ${{ secrets.MAVEN_SIGNING_KEY_BASE64 }} | |
| MAVEN_SIGNING_PASSPHRASE: ${{ secrets.MAVEN_SIGNING_PASSPHRASE }} | |
| MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | |
| MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} |