Skip to content

Commit

Permalink
Cache Maven resolver cache and Maven/Gradle homes
Browse files Browse the repository at this point in the history
  • Loading branch information
mhalbritter committed Feb 5, 2024
1 parent ef4bade commit a62f855
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,15 @@ jobs:
distribution: 'liberica'
cache: 'maven'

- name: Run the Maven verify phase
- name: Cache Maven/Gradle repositories for tests
uses: actions/cache@v4
with:
path: |
/tmp/maven-version-resolver-cache
/tmp/homes
key: ${{ runner.os }}-test-repositories

- name: Build with Maven
run: ./mvnw --batch-mode --update-snapshots verify

- name: Set up Azure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ void release(Path home) {
private Path createTempDirectory() {
try {
Path path = Path.of(System.getProperty("java.io.tmpdir"))
.resolve("homes")
.resolve(this.prefix + "-" + this.counter.getAndIncrement());
Files.createDirectories(path);
return path;
Expand Down

0 comments on commit a62f855

Please sign in to comment.