Skip to content
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

Update GitHub Actions #181

Merged
merged 7 commits into from
Jun 20, 2024
Merged
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: 21 additions & 0 deletions .github/workflows/AccessibilityDemo.yml
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
21 changes: 21 additions & 0 deletions .github/workflows/ClassicsKotlin.yml
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
21 changes: 21 additions & 0 deletions .github/workflows/JetStreamCompose.yml
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
21 changes: 21 additions & 0 deletions .github/workflows/Leanback.yml
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
21 changes: 21 additions & 0 deletions .github/workflows/LeanbackShowcase.yml
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
21 changes: 21 additions & 0 deletions .github/workflows/ReferenceAppKotlin.yml
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
21 changes: 21 additions & 0 deletions .github/workflows/TvMaterialCatalog.yml
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
43 changes: 0 additions & 43 deletions .github/workflows/android.yml

This file was deleted.

78 changes: 78 additions & 0 deletions .github/workflows/build-sample-without-check.yml
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
88 changes: 88 additions & 0 deletions .github/workflows/build-sample.yml
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
Loading
Loading