Skip to content

[#280] Migrate test jobs except Firebase Lab testing to GitHub Actions #379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ jobs:
- 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
Expand All @@ -43,9 +40,6 @@ 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:
Expand Down Expand Up @@ -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
Expand Down
118 changes: 118 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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
17 changes: 14 additions & 3 deletions .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions .java-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
17