Urgent.News

What's breaking now, across thousands of outlets.

Tech

Cache Gradle GitHub Actions builds, and Maven, with numbers

To cache Gradle GitHub Actions runs, use gradle/actions/setup-gradle , which keeps the whole Gradle User Home rather than the dependency folder alone; for Maven, use actions/setup-java with cache: maven , which is a managed actions/cache over ~/.m2/repository . On one small Spring project measured on a Latchkey runner, the Gradle cache was worth 22.0 seconds a run and the Maven cache 10.3…

To optimize Gradle and Maven builds using GitHub Actions, two specific actions can be utilized: gradle/actions/setup-gradle and actions/setup-java. The gradle/actions/setup-gradle action caches the entire Gradle User Home, while actions/setup-java caches Maven's ~/.m2/repository directory.

For Maven, caching is straightforward as the directory only contains downloaded artifacts. However, Gradle's cache includes the dependency cache, wrapper distributions, generated jars, transformed artifacts, and the local build cache. The official action manages which of these to keep.

In a test project, the Gradle cache saved 22.0 seconds per run, and the Maven cache saved 10.3 seconds. When emptying the dependency directory for both tools, a cold run took 29.3 seconds for Gradle and 14.1 seconds for Maven. With the cache restored, these times dropped to 7.3 seconds for Gradle and 3.8 seconds for Maven.

To manage caches effectively, it is recommended to use actions/setup-java for Maven and gradle/actions/setup-gradle for Gradle. Avoid using actions/cache on the Gradle User Home or pairing actions/setup-java with cache: gradle, as this can cause conflicts. Additionally, note that setup-gradle only writes cache entries from jobs on the default branch, meaning long-lived feature branches may still download missing dependencies on each run.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Larp Detected; Assignment Rejected

There is a beautiful moment after submitting homework when the assignment stops being your problem. You close the tabs. Forget the notation. Become someone who has never heard of question three.

  • GradeProof assesses students' understanding of homework.
  • App conducts a five-minute oral examination focusing on reasoning.
  • Scoring system recognizes genuine understanding without penalizing accents.

Detect 5-Axis Rotary Reversals Before They Become Surface Marks

A collision check answers an important question: does the modeled tool assembly intersect the modeled part, fixture or machine envelope?

  • Python script analyzes rotary axis reversals in toolpath
  • Flags reversals when linear speed drops and rotary velocity changes sign
  • Engineers examine contact geometry and surface conditions at flagged timestamps

Docker unexpected status code from registry in CI

A docker unexpected status code from registry message tells you which client gave up, and each of the three clients in play words it differently and fires on a different range of status codes.

  • Unexpected status code from registry indicates issues in CI pipeline
  • Docker distribution client provides generic error message
  • Containerd client includes additional details like method and URL

More from Sunday 15 November →