kyuubi/.github/actions
Fu Chen aaa006c1dc
[KYUUBI #4856] [INFRA] Add restore-keys for action/cache
### _Why are the changes needed?_

add `restore-keys` to restore the most recently maven binary

[github docs](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key)
> restore-keys allows you to specify a list of alternate restore keys to use when there is a cache miss on key. You can create multiple restore keys ordered from the most specific to least specific. The cache action searches the restore-keys in sequential order. When a key doesn't match directly, the action searches for keys prefixed with the restore key. If there are multiple partial matches for a restore key, the action returns the most recently created cache.

logs from [github action](https://github.com/apache/kyuubi/actions/runs/5020359871/jobs/9001759790?pr=4856) (after we update the file `pom.xml` hash)

```
Prepare all required actions
Getting action download info
Run ./.github/actions/setup-maven
Run actions/cachev3
Received 0 of 8173297 (0.0%), 0.0 MBs/sec
Received 8173297 of 8173297 (100.0%), 6.5 MBs/sec
Cache Size: ~8 MB (8173297 B)
/usr/bin/tar -xf /home/runner/work/_temp/0e0ca716-97a4-4d83-af3b-9703003cdd33/cache.tzst -P -C /home/runner/work/kyuubi/kyuubi --use-compress-program unzstd
Cache restored successfully
Cache restored from key: setup-maven-e425be8ee60f158fc4f40b3c6b1a51cb2896e5c97dbbe7c61a96d91380342b89
Run build/mvn -v
Using `mvn` from path: /usr/bin/mvn
Apache Maven 3.8.8 (4c87b05d9aedce574290d1acc98575ed5eb6cd39)
Maven home: /usr/share/apache-maven-3.8.8
Java version: 1.8.0_362, vendor: Temurin, runtime: /usr/lib/jvm/temurin-8-jdk-amd64/jre
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "5.15.0-1037-azure", arch: "amd64", family: "unix"
```

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #4856 from cfmcgrady/ga-cache.

Closes #4856

779e9030e [Fu Chen] Update .github/actions/setup-maven/action.yaml
d663b1a42 [Fu Chen] Revert "test cache restore"
3d3f16013 [Fu Chen] test cache restore
d2d18b613 [Fu Chen] add restore-keys

Authored-by: Fu Chen <cfmcgrady@gmail.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
2023-05-19 11:20:49 +08:00
..
cache-engine-archives [KYUUBI #4348] [INFRA] Cache engine archives in CI jobs for maven download plugin 2023-02-18 22:34:02 +08:00
setup-maven [KYUUBI #4856] [INFRA] Add restore-keys for action/cache 2023-05-19 11:20:49 +08:00
tune-runner-vm