forked from androidx/constraintlayout
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (68 loc) · 3.21 KB
/
experiment-viewtransition.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: experiment-viewtransition
on:
push:
branches: [main]
paths:
- 'constraintlayout/**.java'
- 'constraintlayout/**.kt'
- 'constraintlayout/**.xml'
- 'constraintlayout/**.gradle'
- 'projects/ViewTransitionExperiments/**.kt'
- 'projects/ViewTransitionExperiments/**.xml'
- 'projects/ViewTransitionExperiments/**.gradle'
pull_request:
paths:
- 'constraintlayout/**.java'
- 'constraintlayout/**.kt'
- 'constraintlayout/**.xml'
- 'constraintlayout/**.gradle'
- 'projects/ViewTransitionExperiments/**.kt'
- 'projects/ViewTransitionExperiments/**.xml'
- 'projects/ViewTransitionExperiments/**.gradle'
defaults:
run:
working-directory: ./projects/ViewTransitionExperiments
env:
OUT_DIR: "/tmp/out"
DIST_DIR: "/tmp/out/dist"
GRADLE_HOME: ${{ github.workspace }}/gradle-home
jobs:
assemble:
name: Assemble
runs-on: ubuntu-latest
steps:
# These setup steps should be common across all jobs in this workflow.
- name: Checkout
uses: actions/checkout@v2
- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
## Caching
- name: Cache gradle dependencies
uses: actions/cache@v2
with:
path: ${{ env.GRADLE_HOME }}/caches
# Include the SHA in the hash so this step always adds a cache entry. If we didn't use the SHA, the artifacts
# would only get cached once for each build config hash.
# Don't use ${{ runner.os }} in the key so we don't re-assemble for UI tests.
key: gradle-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/buildSrc/**') }}-${{ github.sha }}
# The first time a SHA is assembled, we still want to load dependencies from the cache.
# Note that none of jobs dependent on this one need restore keys, since they'll always have an exact hit.
restore-keys: |
gradle-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/buildSrc/**') }}-
# We want to keep the dependencies from the cache, but clear out the build cache which contains the actual
# compiled artifacts from this project. This ensures we don't run into any issues with stale cache entries,
# and that the resulting cache we upload for the other jobs won't waste any space on stale binaries.
# A simpler approach would be simply to delete the build-cache before uploading the cache archive, however
# if we did that in this job it would defeat the purpose of sharing that directory with dependent jobs,
# and there's no way to modify the cache after the job that created it finishes.
- name: Clean gradle build cache to assemble fresh
run: |
ls -lhrt "$GRADLE_HOME/caches" || true
rm -rf "$GRADLE_HOME/caches/build-cache-1"
ls -lhrt "$GRADLE_HOME/caches" || true
- name: Assemble with gradle
run: ./gradlew :app:assemble --build-cache --no-daemon --stacktrace --gradle-user-home "$GRADLE_HOME"