Skip to content

Commit 2ba332e

Browse files
authored
Cache LFS content (fix issue/127) (#128)
* Cache LFS content (fix issue/127) and fix icu cache by adding save action * only perform lfs action if missed the cache * Add ls to debug the content restored * Debug * Correct path * fix * Remove dupicate lines
1 parent 168a598 commit 2ba332e

File tree

2 files changed

+46
-2
lines changed

2 files changed

+46
-2
lines changed

.github/workflows/cmake-multi-platform.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,30 @@ jobs:
8383

8484
steps:
8585
- uses: actions/checkout@v4
86+
87+
- name: Create Git LFS file list
88+
run: git lfs ls-files -l |cut -d' ' -f1 |sort >.git/lfs-hashes.txt
89+
90+
- name: Restore Git LFS object cache
91+
uses: actions/cache@v4
92+
id: lfscache
8693
with:
87-
lfs: 'true'
94+
path: inflection/resources/org/unicode/inflection/dictionary
95+
key: ${{ runner.os }}-lfsdata-v1-${{ hashFiles('.git/lfs-hashes.txt') }}
96+
restore-keys: |
97+
${{ runner.os }}-lfsdata-v1-
98+
${{ runner.os }}-lfsdata
99+
100+
- name: Fetch any needed Git LFS objects and prune extraneous ones
101+
if: steps.lfscache.outputs.cache-hit != 'true'
102+
run: git lfs fetch --prune
103+
104+
- name: Check out Git LFS content
105+
if: steps.lfscache.outputs.cache-hit != 'true'
106+
run: git lfs checkout
107+
108+
- name: Check LFS restore the files or not after checkout
109+
run: ls -l inflection/resources/org/unicode/inflection/dictionary/*
88110

89111
- name: Set reusable strings
90112
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.

.github/workflows/ubuntu-memory-check.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,30 @@ jobs:
6363

6464
steps:
6565
- uses: actions/checkout@v4
66+
67+
- name: Create Git LFS file list
68+
run: git lfs ls-files -l |cut -d' ' -f1 |sort >.git/lfs-hashes.txt
69+
70+
- name: Restore Git LFS object cache
71+
id: lfscache
72+
uses: actions/cache@v4
6673
with:
67-
lfs: 'true'
74+
path: inflection/resources/org/unicode/inflection/dictionary
75+
key: ${{ runner.os }}-lfsdata-v1-${{ hashFiles('.git/lfs-hashes.txt') }}
76+
restore-keys: |
77+
${{ runner.os }}-lfsdata-v1-
78+
${{ runner.os }}-lfsdata
79+
80+
- name: Fetch any needed Git LFS objects and prune extraneous ones
81+
if: steps.lfscache.outputs.cache-hit != 'true'
82+
run: git lfs fetch --prune
83+
84+
- name: Check out Git LFS content
85+
if: steps.lfscache.outputs.cache-hit != 'true'
86+
run: git lfs checkout
87+
88+
- name: Check LFS restore the files or not after checkout
89+
run: ls -l inflection/resources/org/unicode/inflection/dictionary/*
6890

6991
- name: Set reusable strings
7092
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.

0 commit comments

Comments
 (0)