From 69a21e1fec7925c454e0d0e9b03b226ce7759a4d Mon Sep 17 00:00:00 2001 From: Jumpei Matsuda Date: Sat, 2 Aug 2025 22:27:57 +0900 Subject: [PATCH 1/2] ci: Create a build.yml for GH actions and remove tests from CircleCI --- .circleci/config.yml | 31 +---- .github/workflows/build.yml | 118 ++++++++++++++++++ .../workflows/gradle-wrapper-validation.yml | 17 ++- .java-version | 1 + 4 files changed, 138 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 .java-version diff --git a/.circleci/config.yml b/.circleci/config.yml index fbcd6d03..de25ed44 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,13 +23,10 @@ jobs: steps: - checkout - restore_cache: - <<: *cache_key + <<: *cache_key - run: name: (Plugin) Build command: cd plugin && ./gradlew :android-junit5:assemble --stacktrace - - run: - name: (Plugin) Test - command: cd plugin && ./gradlew :build-logic:test :android-junit5:check --stacktrace - run: name: (Instrumentation) Download Dependencies command: cd instrumentation && ./gradlew androidDependencies @@ -43,14 +40,11 @@ jobs: :extensions:assembleDebug \ :runner:assembleDebug \ :sample:assembleDebug --stacktrace - - run: - name: (Instrumentation) Test - command: cd instrumentation && ./gradlew :core:check :extensions:check :runner:check :compose:check --stacktrace - save_cache: - <<: *cache_key - paths: - - ~/.gradle/caches - - ~/.gradle/wrapper + <<: *cache_key + paths: + - ~/.gradle/caches + - ~/.gradle/wrapper - run: name: Store Google Service Account command: echo $GCLOUD_SERVICE_KEY > ${HOME}/gcloud-service-key.json @@ -81,24 +75,9 @@ jobs: root: ~/root paths: - project - - store_artifacts: - path: plugin/android-junit5/build/reports/tests/test - destination: plugin - - store_artifacts: - path: instrumentation/core/build/reports - destination: instrumentation-core - store_artifacts: path: test-lab-results destination: instrumentation-core/test-lab-results - - store_artifacts: - path: instrumentation/extensions/build/reports - destination: instrumentation-extensions - - store_artifacts: - path: instrumentation/runner/build/reports - destination: instrumentation-runner - - store_artifacts: - path: instrumentation/compose/build/reports - destination: instrumentation-compose deploy: <<: *defaults diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..14938371 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,118 @@ +name: Build and Test + +on: + push: + branches: + - main + pull_request: + types: + - opened + - synchronize + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + +env: + # '>' join lines by a space + GRADLE_OPTS: > + -XX:+HeapDumpOnOutOfMemoryError + -Dorg.gradle.jvmargs=-Xmx4g + -Dorg.gradle.daemon=false + -Dorg.gradle.caching=true + -Dorg.gradle.configureondemand=true + -Dkotlin.compiler.execution.strategy=in-process + -Dkotlin.incremental=false + +jobs: + build-plugin: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 + with: + distribution: 'zulu' + java-version-file: .java-version + + - uses: gradle/actions/setup-gradle@ac638b010cf58a27ee6c972d7336334ccaf61c96 # v4.4.1 + + - name: (Plugin) Build + run: ./gradlew :android-junit5:assemble --stacktrace + working-directory: plugin + + - name: (Plugin) Test + run: ./gradlew :build-logic:test :android-junit5:check --stacktrace + working-directory: plugin + - name: Save test reports of plugins + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + if: always() + with: + name: test-reports-plugin + path: plugin/android-junit5/build/reports/tests/test + retention-days: 3 + if-no-files-found: error + build-instrumentation: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 + with: + distribution: 'zulu' + java-version-file: .java-version + + - uses: gradle/actions/setup-gradle@ac638b010cf58a27ee6c972d7336334ccaf61c96 # v4.4.1 + + - name: (Instrumentation) Download Dependencies + run: ./gradlew androidDependencies + working-directory: instrumentation + - name: (Instrumentation) Build + run: | + ./gradlew assembleRelease :core:assembleDebug \ + :core:assembleDebugAndroidTest \ + :compose:assembleDebugAndroidTest \ + :extensions:assembleDebug \ + :runner:assembleDebug \ + :sample:assembleDebug --stacktrace + working-directory: instrumentation + - name: (Instrumentation) Test + run: ./gradlew :core:check :extensions:check :runner:check :compose:check --stacktrace + working-directory: instrumentation + + - name: Save instrumentation test reports of core + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + if: always() + with: + name: instrumentation-test-reports-core + path: instrumentation/core/build/reports + retention-days: 3 + if-no-files-found: error + - name: Save instrumentation test reports of extensions + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + if: always() + with: + name: instrumentation-test-reports-extensions + path: instrumentation/extensions/build/reports + retention-days: 3 + if-no-files-found: error + - name: Save instrumentation test reports of runner + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + if: always() + with: + name: instrumentation-test-reports-runner + path: instrumentation/runner/build/reports + retention-days: 3 + if-no-files-found: error + - name: Save instrumentation test reports of compose + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + if: always() + with: + name: instrumentation-test-reports-compose + path: instrumentation/compose/build/reports + retention-days: 3 + if-no-files-found: error diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml index 405a2b30..a3a78aa3 100644 --- a/.github/workflows/gradle-wrapper-validation.yml +++ b/.github/workflows/gradle-wrapper-validation.yml @@ -1,10 +1,21 @@ name: "Validate Gradle Wrapper" -on: [push, pull_request] +on: + push: + branches: + - main + pull_request: + types: + - opened + - synchronize + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true jobs: validation: name: "Validation" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: gradle/wrapper-validation-action@v1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: gradle/actions/wrapper-validation@ac638b010cf58a27ee6c972d7336334ccaf61c96 # v4.4.1 diff --git a/.java-version b/.java-version new file mode 100644 index 00000000..98d9bcb7 --- /dev/null +++ b/.java-version @@ -0,0 +1 @@ +17 From 8bca6335e85cd87d8a7aaa855c7ee3dc6216fe51 Mon Sep 17 00:00:00 2001 From: Jumpei Matsuda Date: Tue, 5 Aug 2025 17:03:10 +0900 Subject: [PATCH 2/2] chore: Revert unexpected space changes in circleci/config.yml --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index de25ed44..8e608285 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,7 +23,7 @@ jobs: steps: - checkout - restore_cache: - <<: *cache_key + <<: *cache_key - run: name: (Plugin) Build command: cd plugin && ./gradlew :android-junit5:assemble --stacktrace @@ -41,10 +41,10 @@ jobs: :runner:assembleDebug \ :sample:assembleDebug --stacktrace - save_cache: - <<: *cache_key - paths: - - ~/.gradle/caches - - ~/.gradle/wrapper + <<: *cache_key + paths: + - ~/.gradle/caches + - ~/.gradle/wrapper - run: name: Store Google Service Account command: echo $GCLOUD_SERVICE_KEY > ${HOME}/gcloud-service-key.json