Aperture: Use composite action for running builds
Change-Id: Ic41adcd3e9a330ce935111ecdd703825ff10d173
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index a83988f..e1883d6 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -10,24 +10,5 @@
- name: Checkout repo
uses: actions/checkout@v3
- - name: Setup JDK 17
- uses: actions/setup-java@v3
- with:
- distribution: 'zulu'
- java-version: 17
-
- - name: Build with Gradle
- run: ./gradlew assembleDebug
-
- - name: Generate Android.bp
- run: |
- ./gradlew app:generateBp
- if [[ ! -z $(git status -s) ]]; then
- git status
- exit -1
- fi
-
- - uses: actions/upload-artifact@v3
- with:
- name: app-debug.apk
- path: app/build/outputs/apk/debug/app-debug.apk
+ - name: Build
+ uses: ./.github/workflows/build
diff --git a/.github/workflows/build/action.yml b/.github/workflows/build/action.yml
new file mode 100644
index 0000000..444a6a0
--- /dev/null
+++ b/.github/workflows/build/action.yml
@@ -0,0 +1,29 @@
+name: build
+
+runs:
+ using: composite
+
+ steps:
+ - name: Setup JDK 17
+ uses: actions/setup-java@v3
+ with:
+ distribution: 'zulu'
+ java-version: 17
+
+ - name: Build with Gradle
+ shell: bash
+ run: ./gradlew assembleDebug
+
+ - name: Generate Android.bp
+ shell: bash
+ run: |
+ ./gradlew app:generateBp
+ if [[ ! -z $(git status -s) ]]; then
+ git status
+ exit -1
+ fi
+
+ - uses: actions/upload-artifact@v3
+ with:
+ name: app-debug.apk
+ path: app/build/outputs/apk/debug/app-debug.apk
diff --git a/.github/workflows/gerrit.yml b/.github/workflows/gerrit.yml
index a7e6388..0f6ce69 100644
--- a/.github/workflows/gerrit.yml
+++ b/.github/workflows/gerrit.yml
@@ -20,24 +20,5 @@
gerrit-ref: ${{ inputs.gerrit-ref }}
ref: ${{ inputs.ref }}
- - name: Setup JDK 17
- uses: actions/setup-java@v3
- with:
- distribution: 'zulu'
- java-version: 17
-
- - name: Build with Gradle
- run: ./gradlew assembleDebug
-
- - name: Generate Android.bp
- run: |
- ./gradlew app:generateBp
- if [[ ! -z $(git status -s) ]]; then
- git status
- exit -1
- fi
-
- - uses: actions/upload-artifact@v3
- with:
- name: app-debug.apk
- path: app/build/outputs/apk/debug/app-debug.apk
+ - name: Build
+ uses: ./.github/workflows/build