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

Introduce the dependency caching for Maven and Gradle #193

Merged
merged 26 commits into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
fef7d58
implement a core logic to cache dependnecies
KengoTODA Jul 13, 2021
4a7bf99
integrate the cache logic to entry points
KengoTODA Jul 13, 2021
945940e
add a user doc about the dependency cache feature
KengoTODA Jul 13, 2021
0591f86
reflect changes to the dist dir
KengoTODA Jul 13, 2021
f537562
add a prefix to the cache key
KengoTODA Jul 14, 2021
b047f97
test: extract build.gradle to a file in __tests__ dir
KengoTODA Jul 14, 2021
3e2fde2
run the restore e2e test on the specified OS
KengoTODA Jul 14, 2021
a5a0c52
add an e2e test for maven
KengoTODA Jul 14, 2021
1872d8e
fix the dependency among workflows
KengoTODA Jul 14, 2021
313e1ad
stabilize the cache on the Windows in e2e test
KengoTODA Jul 15, 2021
8687e45
add .gitignore files to __tests__/cache directories
KengoTODA Jul 15, 2021
6977c03
try to run restore after the authentication
KengoTODA Jul 14, 2021
7fe6c4d
use the key in state to save caches in the post process
KengoTODA Jul 15, 2021
fae2927
suggest users to run without daemon if fail to save Gradle cache on W…
KengoTODA Jul 20, 2021
f6a3b97
add missing description in the README.md
KengoTODA Jul 20, 2021
5f3f74c
run clean-up tasks in serial
KengoTODA Aug 2, 2021
53f73ba
Add validation for post step (#3)
dmitry-shibanov Aug 18, 2021
862dedb
Merge remote-tracking branch 'origin/main' into introduce-cache
KengoTODA Aug 18, 2021
098a656
Update src/cleanup-java.ts
KengoTODA Aug 19, 2021
cb966d0
Update src/cache.ts
KengoTODA Aug 19, 2021
6edf849
style: put the name of input to the constants.ts
KengoTODA Aug 19, 2021
0082baa
format: run `npm run build` to reflect changes to the dist dir
KengoTODA Aug 19, 2021
ea721b3
chore: update licensed files by `licensed cache`
KengoTODA Aug 19, 2021
807e574
fix: rerun ncc on macOS with node v12
KengoTODA Aug 19, 2021
33dfe17
build: follow the suggestion at PR page
KengoTODA Aug 19, 2021
67b74a1
fix: throw error in case of no package manager file found
KengoTODA Aug 19, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 113 additions & 0 deletions .github/workflows/e2e-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: Validate cache
on:
push:
KengoTODA marked this conversation as resolved.
Show resolved Hide resolved
branches:
- main
- releases/*
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'

defaults:
run:
shell: bash

jobs:
gradle-save:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run setup-java with the cache for gradle
uses: ./
id: setup-java
with:
distribution: 'adopt'
java-version: '11'
cache: gradle
- name: Create files to cache
# Need to avoid using Gradle daemon to stabilize the save process on Windows
# https://github.com/actions/cache/issues/454#issuecomment-840493935
run: |
gradle downloadDependencies --no-daemon -p __tests__/cache/gradle
if [ ! -d ~/.gradle/caches ]; then
echo "::error::The ~/.gradle/caches directory does not exist unexpectedly"
exit 1
fi
gradle-restore:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
needs: gradle-save
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run setup-java with the cache for gradle
uses: ./
id: setup-java
with:
distribution: 'adopt'
java-version: '11'
cache: gradle
- name: Confirm that ~/.gradle/caches directory has been made
run: |
if [ ! -d ~/.gradle/caches ]; then
echo "::error::The ~/.gradle/caches directory does not exist unexpectedly"
exit 1
fi
ls ~/.gradle/caches/
maven-save:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run setup-java with the cache for maven
uses: ./
id: setup-java
with:
distribution: 'adopt'
java-version: '11'
cache: maven
- name: Create files to cache
run: |
mvn verify -f __tests__/cache/maven/pom.xml
if [ ! -d ~/.m2/repository ]; then
echo "::error::The ~/.m2/repository directory does not exist unexpectedly"
exit 1
fi
maven-restore:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
needs: maven-save
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run setup-java with the cache for maven
uses: ./
id: setup-java
with:
distribution: 'adopt'
java-version: '11'
cache: maven
- name: Confirm that ~/.m2/repository directory has been made
run: |
if [ ! -d ~/.m2/repository ]; then
echo "::error::The ~/.m2/repository directory does not exist unexpectedly"
exit 1
fi
ls ~/.m2/repository
1 change: 1 addition & 0 deletions .licensed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ sources:

allowed:
- apache-2.0
- 0bsd
- bsd-2-clause
- bsd-3-clause
- isc
Expand Down
20 changes: 20 additions & 0 deletions .licenses/npm/@actions/cache.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions .licenses/npm/@actions/glob-0.1.2.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions .licenses/npm/@actions/glob-0.2.0.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions .licenses/npm/@azure/abort-controller.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions .licenses/npm/@azure/core-asynciterator-polyfill.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions .licenses/npm/@azure/core-auth.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions .licenses/npm/@azure/core-http.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions .licenses/npm/@azure/core-lro.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions .licenses/npm/@azure/core-paging.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading