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

Improve the cache test case #59

Merged
merged 3 commits into from
Oct 15, 2020
Merged
Changes from 1 commit
Commits
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
20 changes: 13 additions & 7 deletions .github/workflows/verify-on-ubuntu-user-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,22 @@ jobs:
- name: Checkout source code
uses: actions/checkout@v1

- name: Get time
id: info
uses: actions/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN}}
yi-Xu-0100 marked this conversation as resolved.
Show resolved Hide resolved
result-encoding: string
script: |
return new Date(Date.now()).toISOString().replace(/[^0-9]/g, "");

- name: Cache src repos
uses: actions/cache@v1
id: cache
with:
path: /home/runner/work/hub-mirror-action/hub-mirror-action/hub-mirror-cache
key: ${{ runner.os }}-yikun-repos-cache

- name: Print the cache status
if: steps.cache.outputs.cache-hit == 'true'
run: echo "Cached successfully."
path: ${{ github.workspace }}/hub-mirror-cache
key: ${{ runner.os }}-yikun-repos-cache-${{ steps.info.outputs.time }}
yi-Xu-0100 marked this conversation as resolved.
Show resolved Hide resolved
restore-keys: ${{ runner.os }}-yikun-repos-cache-

- name: Mirror Github to Gitee with white list and cache
uses: ./.
Expand All @@ -32,4 +38,4 @@ jobs:

- name: Print cache path
run: |
ls -la /home/runner/work/hub-mirror-action/hub-mirror-action/hub-mirror-cache
ls -la ${{ github.workspace }}/hub-mirror-cache