Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure dependency cache on GitHub Actions #1826

Closed
6 tasks
marcphilipp opened this issue Mar 19, 2019 · 11 comments
Closed
6 tasks

Configure dependency cache on GitHub Actions #1826

marcphilipp opened this issue Mar 19, 2019 · 11 comments

Comments

@marcphilipp
Copy link
Member

marcphilipp commented Mar 19, 2019

In order to speed up builds on GitHub Actions: https://github.com/marketplace/actions/cache

Jobs

  • Linux (uses container: junitteam/build:latest)
  • Windows
  • Mac OS
  • Coverage (uses container: junitteam/build:latest)
  • Publish Snapshot Artifacts
  • Update Snapshot Documentation
@marcphilipp marcphilipp added this to the 5.5 M2 milestone Mar 19, 2019
@marcphilipp marcphilipp modified the milestones: 5.5 M2, 5.5 Backlog Apr 18, 2019
sormuras added a commit that referenced this issue Nov 15, 2019
@sormuras sormuras self-assigned this Nov 15, 2019
@sormuras sormuras modified the milestones: 5.7 Backlog, 5.6 M2 Nov 15, 2019
@sormuras sormuras changed the title Configure dependency cache on Azure Pipelines Configure dependency cache on GitHub Actions Nov 15, 2019
sormuras added a commit that referenced this issue Nov 15, 2019
@sormuras
Copy link
Member

More directories to cache

  • gradle/** which contains testing.gradle.kts and the wrapper

More keys to hash

  • buildSrc entries, like Versions.kt and friends

.lock files are ... locked

It's not that easy: https://github.com/junit-team/junit5/runs/305358249#step:9:1

Post job cleanup.
"C:\Program Files\Git\usr\bin\tar.exe" -cz --force-local -f d:/a/_temp/6533d433-2e40-451d-b1b0-3824be622ba3/cache.tgz -C C:/Users/runneradmin/.gradle/caches .
/usr/bin/tar: ./6.0/executionHistory/executionHistory.lock: Read error at byte 0, while reading 38 bytes: Device or resource busy
/usr/bin/tar: ./6.0/fileContent/fileContent.lock: Read error at byte 0, while reading 38 bytes: Device or resource busy
/usr/bin/tar: ./6.0/fileHashes/fileHashes.lock: Read error at byte 0, while reading 38 bytes: Device or resource busy
/usr/bin/tar: ./6.0/generated-gradle-jars/generated-gradle-jars.lock: Read error at byte 0, while reading 38 bytes: Device or resource busy
/usr/bin/tar: ./6.0/javaCompile/javaCompile.lock: Read error at byte 0, while reading 38 bytes: Device or resource busy
/usr/bin/tar: ./jars-3/jars-3.lock: Read error at byte 0, while reading 38 bytes: Device or resource busy
/usr/bin/tar: ./journal-1/journal-1.lock: Read error at byte 0, while reading 38 bytes: Device or resource busy
/usr/bin/tar: ./modules-2/modules-2.lock: Read error at byte 0, while reading 38 bytes: Device or resource busy
/usr/bin/tar: Exiting with failure status due to previous errors
##[warning]The process 'C:\Program Files\Git\usr\bin\tar.exe' failed with exit code 2

@sormuras
Copy link
Member

Reverting the changes for the time being.

Reserved for future configuration attempts:

    - name: 'Cache Gradle repository'
      uses: actions/cache@v1
      with:
        path: ~/.gradle/caches
        key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
        restore-keys: ${{ runner.os }}-gradle-

sormuras added a commit that referenced this issue Nov 15, 2019
sormuras added a commit that referenced this issue Nov 16, 2019
@sormuras
Copy link
Member

https://github.com/junit-team/junit5/runs/306095038#step:9:3 says:

##[warning]Cache size of 1947987186 bytes is over the 400MB limit, not saving cache.

@sormuras
Copy link
Member

--no-build-cache might help here.

@marcphilipp
Copy link
Member Author

Let's try caching only ~/.gradle/caches/modules-2/

@sormuras sormuras modified the milestones: 5.6 M2, 5.7 Backlog Dec 5, 2019
@stale
Copy link

stale bot commented May 13, 2021

This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. Thank you for your contribution.

@stale stale bot added the status: stale label May 13, 2021
@jbduncan
Copy link
Contributor

I never said so before, but I'm in support of this proposed change.

@stale stale bot removed the status: stale label May 13, 2021
@marcphilipp marcphilipp removed this from the 5.8 Backlog milestone Jun 19, 2021
@stale
Copy link

stale bot commented Jun 19, 2022

This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. Thank you for your contribution.

@stale stale bot added the status: stale label Jun 19, 2022
@stale
Copy link

stale bot commented Jul 11, 2022

This issue has been automatically closed due to inactivity. If you have a good use case for this feature, please feel free to reopen the issue.

@stale stale bot closed this as completed Jul 11, 2022
@sbrannen sbrannen reopened this Jul 12, 2022
@StefMa
Copy link

StefMa commented Nov 17, 2023

Hey guys,

I just came up with the same issue regarding locking files your had here as well.
For me these locking files were only locked in windows machines.
I fixed it by running Gradle without a daemon.
I think it will also work to stop the daemon (./gradlew --stop) before saving of the cache happen.

Just wanted to let you know this 🙃

@marcphilipp
Copy link
Member Author

We have actually since adopted the official Gradle GitHub Action that also takes care of configuring caching.

@marcphilipp marcphilipp closed this as not planned Won't fix, can't repro, duplicate, stale Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants