每次触发我的构建工作流时,都会下载Maven依赖项。
Travis CI提供了一种缓存maven存储库的方法。Github actions是否提供了允许缓存maven存储库的类似功能?
发布于 2019-09-10 13:15:43
显然,截至2019年9月10日,Github操作中不存在构建依赖项的缓存。Github的工作人员已经承认这个功能是必要的,并回答说“我们正在致力于在工作流执行之间缓存包和工件,我们将在2019年11月中旬推出它。”
发布于 2020-01-03 07:38:00
为了完整性,这是一个如何在后续构建中缓存本地Maven存储库的示例:
steps:
# Typical Java workflow steps
- uses: actions/checkout@v1
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
# Step that does that actual cache save and restore
- uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# Step that runs the tests
- name: Run tests
run: mvn test有关更多详细信息,请参阅this page。
发布于 2019-11-17 12:56:18
https://stackoverflow.com/questions/57695362
复制相似问题