Skip to content

Commit

Permalink
Merge pull request #2 from luizgrp/update_main
Browse files Browse the repository at this point in the history
Update main
  • Loading branch information
luizgrp committed Nov 21, 2023
2 parents eb583f5 + 4916dbf commit 18a1d82
Show file tree
Hide file tree
Showing 2,154 changed files with 125,974 additions and 3,205 deletions.
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
**/test/snapshots/** filter=lfs diff=lfs merge=lfs -text
**/figma/** filter=lfs diff=lfs merge=lfs -text
*.mp4 filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
10 changes: 6 additions & 4 deletions .github/ci-gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
# limitations under the License.
#

# Turn Gradle daemon off due to https://github.com/Kotlin/dokka/issues/1405
org.gradle.daemon=false

org.gradle.configureondemand=true
org.gradle.caching=true
org.gradle.parallel=true

# Declare we support AndroidX
android.useAndroidX=true

org.gradle.jvmargs=-Xmx4608m -XX:MaxMetaspaceSize=1536m -XX:+HeapDumpOnOutOfMemoryError
org.gradle.workers.max=2

kotlin.compiler.execution.strategy=in-process
14 changes: 14 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#### WHAT


#### WHY


#### HOW


#### Checklist :clipboard:
- [ ] Add explicit visibility modifier and explicit return types for public declarations
- [ ] Run spotless check
- [ ] Run tests
- [ ] Update metalava's signature text files
71 changes: 71 additions & 0 deletions .github/workflows/android_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Android Test

on:
push:
branches:
- main
paths-ignore:
- '**.md'
workflow_dispatch:

jobs:
test:
runs-on: macos-latest
timeout-minutes: 50

strategy:
# Allow tests to continue on other devices if they fail on one device.
fail-fast: false
matrix:
api-level: [ 30, 33 ]

env:
TERM: dumb

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
lfs: 'true'

- name: Install pulseaudio
run: brew install pulseaudio

- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

- name: set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: android-wear
profile: wearos_large_round
channel: beta
arch: ${{ matrix.api-level == 33 && 'x86_64' || 'x86' }}
emulator-options: -no-window -no-snapshot
script: ./gradlew connectedDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=Microbenchmark -x media:benchmark:connectedDebugAndroidTest

- name: Upload logs
if: always()
uses: actions/upload-artifact@v3
with:
name: logs-${{ matrix.api-level }}-${{ matrix.shard }}
path: logcat.txt

- name: Upload test results
if: always()
uses: actions/upload-artifact@v3
with:
name: test-results-${{ matrix.api-level }}-${{ matrix.shard }}
path: |
**/build/reports/*
**/build/outputs/*/connected/*
**/out/failures/
158 changes: 88 additions & 70 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,127 +4,145 @@ on:
push:
branches:
- main
- release-0.1.x
paths-ignore:
- '**.md'
pull_request:
workflow_dispatch:

jobs:
build:
# Skip build if head commit contains 'skip ci'
if: "!contains(github.event.head_commit.message, 'skip ci')"

runs-on: ubuntu-latest
timeout-minutes: 30
timeout-minutes: 40

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
# Fetch expanded history, which is needed for affected module detection
fetch-depth: '500'
lfs: 'true'

- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

- name: set up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'zulu'
java-version: 17

- name: Generate cache key
run: ./checksum.sh checksum.txt

- uses: actions/cache@v2
- name: Unit Tests
uses: gradle/gradle-build-action@v2
id: screenshotsverify
continue-on-error: true
with:
path: |
~/.gradle/caches/modules-*
~/.gradle/caches/jars-*
~/.gradle/caches/build-cache-*
key: gradle-${{ hashFiles('checksum.txt') }}
arguments: testDebug --rerun

- name: Build
- name: Prevent pushing new screenshots if this is a fork
id: checkfork
continue-on-error: false
if: steps.screenshotsverify.outcome == 'failure' && github.event.pull_request.head.repo.full_name != github.repository
run: |
./gradlew --scan --stacktrace \
spotlessCheck \
assemble \
metalavaCheckCompatibility \
lintDebug
echo "::error::Screenshot tests failed, please create a PR in your fork first." && exit 1
- name: Unit Tests
- name: Generate new screenshots if verification failed and it's a PR
id: screenshotsrecord
if: steps.screenshotsverify.outcome == 'failure' && github.event_name == 'pull_request'
run: |
./scripts/run-tests.sh \
--unit-tests \
--run-affected \
--affected-base-ref=$BASE_REF
./gradlew testDebug -P screenshot.record=repair
- name: Upload test results
- name: Push new screenshots if available
uses: stefanzweifel/git-auto-commit-action@v5
if: steps.screenshotsrecord.outcome == 'success'
with:
file_pattern: '**/snapshots/images/*.png'
disable_globbing: true
commit_message: "🤖 Updates screenshots"

- name: Upload test results and reports
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: test-results-robolectric
name: build-results
path: |
**/build/test-results/*
**/build/reports/*
**/out/*
test:
runs-on: macos-latest
needs: build
timeout-minutes: 50
compiletests:
# Skip build if head commit contains 'skip ci'
if: "!contains(github.event.head_commit.message, 'skip ci')"

strategy:
# Allow tests to continue on other devices if they fail on one device.
fail-fast: false
matrix:
api-level: [ 28, 30 ]
shard: [ 0, 1 ] # Need to update shard-count below if this changes
runs-on: ubuntu-latest
timeout-minutes: 50

env:
TERM: dumb

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
# Fetch expanded history, which is needed for affected module detection
fetch-depth: '500'
lfs: 'true'

- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

- name: set up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17

- name: Compile tests
uses: gradle/gradle-build-action@v2
with:
arguments: compileDebugAndroidTestSources

verify:
# Skip build if head commit contains 'skip ci'
if: "!contains(github.event.head_commit.message, 'skip ci')"

runs-on: ubuntu-latest
timeout-minutes: 40

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
java-version: 11
lfs: 'true'

- name: Generate cache key
run: ./checksum.sh checksum.txt
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

- uses: actions/cache@v2
- name: set up JDK
uses: actions/setup-java@v3
with:
path: |
~/.gradle/caches/modules-*
~/.gradle/caches/jars-*
~/.gradle/caches/build-cache-*
key: gradle-${{ hashFiles('checksum.txt') }}
distribution: 'zulu'
java-version: 17

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Check GIT lfs images
run: |
./scripts/git-lfs-check.sh
- name: Run tests
uses: reactivecircus/android-emulator-runner@v2
- name: Metalava compatibility check
uses: gradle/gradle-build-action@v2
with:
api-level: ${{ matrix.api-level }}
target: android-wear
profile: wear_round_454
script: ./scripts/run-tests.sh --log-file=logcat.txt --run-affected --affected-base-ref=$BASE_REF --shard-index=${{ matrix.shard }} --shard-count=2
arguments: --stacktrace
metalavaCheckCompatibility metalavaCheckCompatibilityRelease

- name: Upload logs
if: always()
uses: actions/upload-artifact@v2
- name: Code analysis
uses: gradle/gradle-build-action@v2
with:
name: logs-${{ matrix.api-level }}-${{ matrix.shard }}
path: logcat.txt
arguments: --stacktrace
spotlessCheck
lintDebug

- name: Upload test results
if: always()
uses: actions/upload-artifact@v2
- name: Dependencies analysis
uses: gradle/gradle-build-action@v2
if: ${{ false }} # Disabled until -android supported https://github.com/google/horologist/issues/1314
with:
name: test-results-${{ matrix.api-level }}-${{ matrix.shard }}
path: |
**/build/reports/*
**/build/outputs/*/connected/*
arguments: --stacktrace
projectHealth
63 changes: 63 additions & 0 deletions .github/workflows/build_nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Build & test (nightly release)

on:
schedule:
- cron: '0 2 * * *' # 2am UTC
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 40

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
lfs: 'true'

- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

- name: set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17

- name: Generate cache key
run: ./checksum.sh checksum.txt

- uses: actions/cache@v3
with:
path: |
~/.gradle/caches/modules-*
~/.gradle/caches/jars-*
~/.gradle/caches/build-cache-*
key: gradle-${{ hashFiles('checksum.txt') }}

- name: Build (Release)
run: |
./gradlew --scan --stacktrace \
assembleRelease
- name: Code analysis
run: |
./gradlew --scan --stacktrace \
lintRelease
- name: Upload test results and reports
if: always()
uses: actions/upload-artifact@v3
with:
name: build-results
path: |
**/build/test-results/*
**/build/reports/*
- name: Upload apks
if: always()
uses: actions/upload-artifact@v3
with:
name: apks
path: |
**/build/outputs/apk/release/*.apk
Loading

0 comments on commit 18a1d82

Please sign in to comment.