ci: refactor ci workflows to invoke bash scripts #26
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: Generate Baseline Profile | ||
| on: | ||
| workflow_dispatch: | ||
| workflow_call: | ||
| secrets: | ||
| token: | ||
| required: true | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| steps: | ||
| - name: Checkout Branch | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2 | ||
| with: | ||
| persist-credentials: true | ||
| - name: Enable KVM group perms | ||
| run: .github/scripts/enable-kvm.sh | ||
| - name: Setup Java | ||
| uses: actions/setup-java@v5 | ||
| with: | ||
| distribution: 'adopt' | ||
| java-version: 21 | ||
| - name: Setup Gradle | ||
| uses: gradle/actions/setup-gradle@f29f5a9d7b09a7c6b29859002d29d24e1674c884 # v5.0.1 | ||
| - name: Read version | ||
| id: sdk_version | ||
| run: .github/scripts/extract-sdk-version.sh >> "$GITHUB_OUTPUT" | ||
| - name: Publish to Maven local | ||
| run: .github/scripts/gradle-publish-maven-local.sh | ||
| - name: Checkout Android SDK Benchmark | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2 | ||
| with: | ||
| repository: embrace-io/android-sdk-benchmark | ||
| ref: main | ||
| path: ./android-sdk-benchmark | ||
| token: ${{ secrets.GH_ANDROID_SDK_TOKEN }} # NOTE: read android-sdk-benchmark | ||
| persist-credentials: false | ||
| - name: Update Android SDK Benchmark version | ||
| working-directory: android-sdk-benchmark | ||
| env: | ||
| SDK_VERSION: ${{ steps.sdk_version.outputs.sdk_version }} | ||
| run: "$GITHUB_WORKSPACE/.github/scripts/update-benchmark-version.sh" "$SDK_VERSION" | ||
| - name: Clean Managed Devices | ||
| working-directory: android-sdk-benchmark | ||
| run: "$GITHUB_WORKSPACE/.github/scripts/gradle-clean-managed-devices.sh" | ||
| - name: Generate Baseline Profile | ||
| working-directory: android-sdk-benchmark | ||
| run: "$GITHUB_WORKSPACE/.github/scripts/gradle-generate-baseline-profile.sh" | ||
| - name: Move & Rename Baseline Profiles | ||
| run: .github/scripts/copy-baseline-profile.sh | ||
| - name: Create baseline profile PR | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| RUN_ID: ${{ github.run_id }} | ||
| GITHUB_REF_NAME: ${{ github.ref }} | ||
| ACTOR: ${{ github.actor }} | ||
| run: .github/scripts/create-baseline-profile-pr.sh "$RUN_ID" "$GITHUB_REF_NAME" "$ACTOR" | ||