Skip to content

Commit 24552b6

Browse files
committed
[SPARK-32695][INFRA] Explicitly cache and hash 'build' directly in GitHub Actions
### What changes were proposed in this pull request? This PR proposes to explicitly cache and hash the files/directories under 'build' for SBT and Zinc at GitHub Actions. Otherwise, it can end up with overwriting `build` directory. See also #29286 (comment) Previously, other files like `build/mvn` and `build/sbt` are also cached and overwritten. So, when you have some changes there, they are ignored. ### Why are the changes needed? To make GitHub Actions build stable. ### Does this PR introduce _any_ user-facing change? No, dev-only. ### How was this patch tested? The builds in this PR test it out. Closes #29536 from HyukjinKwon/SPARK-32695. Authored-by: HyukjinKwon <[email protected]> Signed-off-by: HyukjinKwon <[email protected]> (cherry picked from commit b07e742) Signed-off-by: HyukjinKwon <[email protected]>
1 parent 9e937c5 commit 24552b6

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

.github/workflows/build_and_test.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,14 @@ jobs:
9292
fetch-depth: 0
9393
# Cache local repositories. Note that GitHub Actions cache has a 2G limit.
9494
- name: Cache Scala, SBT, Maven and Zinc
95-
uses: actions/cache@v1
95+
uses: actions/cache@v2
9696
with:
97-
path: build
98-
key: build-${{ hashFiles('**/pom.xml') }}
97+
path: |
98+
build/apache-maven-*
99+
build/zinc-*
100+
build/scala-*
101+
build/*.jar
102+
key: build-${{ hashFiles('**/pom.xml', 'project/build.properties', 'build/mvn', 'build/sbt', 'build/sbt-launch-lib.bash', 'build/spark-build-info') }}
99103
restore-keys: |
100104
build-
101105
- name: Cache Maven local repository
@@ -109,7 +113,7 @@ jobs:
109113
uses: actions/cache@v2
110114
with:
111115
path: ~/.ivy2/cache
112-
key: ${{ matrix.java }}-${{ matrix.hadoop }}-ivy-${{ hashFiles('**/pom.xml') }}-${{ hashFiles('**/plugins.sbt') }}
116+
key: ${{ matrix.java }}-${{ matrix.hadoop }}-ivy-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }}
113117
restore-keys: |
114118
${{ matrix.java }}-${{ matrix.hadoop }}-ivy-
115119
- name: Install JDK ${{ matrix.java }}

0 commit comments

Comments
 (0)