-
Notifications
You must be signed in to change notification settings - Fork 348
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #181 from chikoski/workstream
Update GitHub Actions
- Loading branch information
Showing
11 changed files
with
353 additions
and
43 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: AccessibilityDemo | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '.github/workflows/AccessibilityDemo.yml' | ||
- 'AccessibilityDemo/**' | ||
pull_request: | ||
paths: | ||
- '.github/workflows/AccessibilityDemo.yml' | ||
- 'AccessibilityDemo/**' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build-sample-without-format-check.yml | ||
with: | ||
name: AccessibilityDemo | ||
path: AccessibilityDemo |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: ClassicsKotlin | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '.github/workflows/ClassicsKotlin.yml' | ||
- 'ClassicsKotlin/**' | ||
pull_request: | ||
paths: | ||
- '.github/workflows/ClassicsKotlin.yml' | ||
- 'ClassicsKotlin/**' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build-sample-without-check.yml | ||
with: | ||
name: ClassicsKotlin | ||
path: ClassicsKotlin |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: JetStreamCompose | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '.github/workflows/JetStreamCompose.yml' | ||
- 'JetStreamCompose/**' | ||
pull_request: | ||
paths: | ||
- '.github/workflows/JetStreamCompose.yml' | ||
- 'JetStreamCompose/**' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build-sample.yml | ||
with: | ||
name: JetStreamCompose | ||
path: JetStreamCompose |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Leanback | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '.github/workflows/Leanback.yml' | ||
- 'Leanback/**' | ||
pull_request: | ||
paths: | ||
- '.github/workflows/Leanback.yml' | ||
- 'Leanback/**' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build-sample-without-check.yml | ||
with: | ||
name: Leanback | ||
path: Leanback |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: LeanbackShowcase | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '.github/workflows/LeanbackShowcase.yml' | ||
- 'LeanbackShowcase/**' | ||
pull_request: | ||
paths: | ||
- '.github/workflows/LeanbackShowcase.yml' | ||
- 'LeanbackShowcase/**' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build-sample-without-check.yml | ||
with: | ||
name: LeanbackShowcase | ||
path: LeanbackShowcase |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: ReferenceAppKotlin | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '.github/workflows/ReferenceAppKotlin.yml' | ||
- 'ReferenceAppKotlin/**' | ||
pull_request: | ||
paths: | ||
- '.github/workflows/ReferenceAppKotlin.yml' | ||
- 'ReferenceAppKotlin/**' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build-sample-without-check.yml | ||
with: | ||
name: ReferenceAppKotlin | ||
path: ReferenceAppKotlin |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: TvMaterialCatalog | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '.github/workflows/TvMaterialCatalog.yml' | ||
- 'TvMaterialCatalog/**' | ||
pull_request: | ||
paths: | ||
- '.github/workflows/TvMaterialCatalog.yml' | ||
- 'TvMaterialCatalog/**' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build-sample-without-check.yml | ||
with: | ||
name: TvMaterialCatalog | ||
path: TvMaterialCatalog |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# Copyright (C) 2024 The Android Open Source Project | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
name: Build sample(legacy) | ||
# This action is for the sample app wihtout buildscript/init.gradle.kts | ||
# This action will be removed once all sample app has the kts file | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
name: | ||
required: true | ||
type: string | ||
path: | ||
required: true | ||
type: string | ||
|
||
concurrency: | ||
group: ${{ inputs.name }}-build-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 17 | ||
distribution: "zulu" | ||
|
||
- name: Generate cache key | ||
run: ./scripts/checksum.sh ${{ inputs.path }} checksum.txt | ||
|
||
- uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.gradle/caches/modules-* | ||
~/.gradle/caches/jars-* | ||
~/.gradle/caches/build-cache-* | ||
key: gradle-${{ hashFiles('checksum.txt') }} | ||
|
||
- name: Build debug | ||
working-directory: ${{ inputs.path }} | ||
run: ./gradlew assembleDebug --stacktrace | ||
|
||
- name: Build release | ||
working-directory: ${{ inputs.path }} | ||
run: ./gradlew assembleRelease --stacktrace | ||
|
||
- name: Upload build outputs (APKs) | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: build-outputs | ||
path: ${{ inputs.path }}/app/build/outputs | ||
|
||
- name: Upload build reports | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: build-reports | ||
path: ${{ inputs.path }}/app/build/reports |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# Copyright (C) 2024 The Android Open Source Project | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
name: Build sample | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
name: | ||
required: true | ||
type: string | ||
path: | ||
required: true | ||
type: string | ||
|
||
concurrency: | ||
group: ${{ inputs.name }}-build-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 17 | ||
distribution: "zulu" | ||
|
||
- name: Generate cache key | ||
run: ./scripts/checksum.sh ${{ inputs.path }} checksum.txt | ||
|
||
- uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.gradle/caches/modules-* | ||
~/.gradle/caches/jars-* | ||
~/.gradle/caches/build-cache-* | ||
key: gradle-${{ hashFiles('checksum.txt') }} | ||
|
||
- name: Check formatting | ||
working-directory: ${{ inputs.path }} | ||
run: ./gradlew --init-script buildscripts/init.gradle.kts spotlessCheck --stacktrace | ||
|
||
- name: Check lint | ||
working-directory: ${{ inputs.path }} | ||
run: ./gradlew lintDebug --stacktrace | ||
|
||
- name: Build debug | ||
working-directory: ${{ inputs.path }} | ||
run: ./gradlew assembleDebug --stacktrace | ||
|
||
- name: Build release | ||
working-directory: ${{ inputs.path }} | ||
run: ./gradlew assembleRelease --stacktrace | ||
|
||
- name: Run local tests | ||
working-directory: ${{ inputs.path }} | ||
run: ./gradlew testDebug --stacktrace | ||
|
||
- name: Upload build outputs (APKs) | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: build-outputs | ||
path: ${{ inputs.path }}/app/build/outputs | ||
|
||
- name: Upload build reports | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: build-reports | ||
path: ${{ inputs.path }}/app/build/reports |
Oops, something went wrong.