Skip to content

Commit b07e742

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]>
1 parent b541030 commit b07e742

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
@@ -99,10 +99,14 @@ jobs:
9999
run: git merge --progress --ff-only origin/${{ github.event.inputs.target }}
100100
# Cache local repositories. Note that GitHub Actions cache has a 2G limit.
101101
- name: Cache Scala, SBT, Maven and Zinc
102-
uses: actions/cache@v1
102+
uses: actions/cache@v2
103103
with:
104-
path: build
105-
key: build-${{ hashFiles('**/pom.xml') }}
104+
path: |
105+
build/apache-maven-*
106+
build/zinc-*
107+
build/scala-*
108+
build/*.jar
109+
key: build-${{ hashFiles('**/pom.xml', 'project/build.properties', 'build/mvn', 'build/sbt', 'build/sbt-launch-lib.bash', 'build/spark-build-info') }}
106110
restore-keys: |
107111
build-
108112
- name: Cache Maven local repository
@@ -116,7 +120,7 @@ jobs:
116120
uses: actions/cache@v2
117121
with:
118122
path: ~/.ivy2/cache
119-
key: ${{ matrix.java }}-${{ matrix.hadoop }}-ivy-${{ hashFiles('**/pom.xml') }}-${{ hashFiles('**/plugins.sbt') }}
123+
key: ${{ matrix.java }}-${{ matrix.hadoop }}-ivy-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }}
120124
restore-keys: |
121125
${{ matrix.java }}-${{ matrix.hadoop }}-ivy-
122126
- name: Install JDK ${{ matrix.java }}

0 commit comments

Comments
 (0)