Skip to content

Commit

Permalink
Improve the cache test case (#59)
Browse files Browse the repository at this point in the history
Use the Linux-yikun-repos-cache-{times} as key, and Linux-yikun-repos-cache- as restore_key to make sure the cache would be refreshed at every PR.

close #58
  • Loading branch information
yi-Xu-0100 authored Oct 15, 2020
1 parent 936754e commit 7681189
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 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,21 @@ jobs:
- name: Checkout source code
uses: actions/checkout@v1

- name: Get time
id: info
uses: actions/[email protected]
with:
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.result }}
restore-keys: ${{ runner.os }}-yikun-repos-cache-

- name: Mirror Github to Gitee with white list and cache
uses: ./.
Expand All @@ -32,4 +37,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

0 comments on commit 7681189

Please sign in to comment.