Skip to content

Commit 07b67a7

Browse files
committed
feat: add submodule cache to build.yaml
1 parent 7fb2bcb commit 07b67a7

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

.github/workflows/build.yaml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ jobs:
3131
uses: actions/checkout@v3
3232
with:
3333
fetch-depth: 0
34-
submodules: true
3534

3635
- name: Install Node.js v16
3736
uses: actions/setup-node@v3
@@ -52,7 +51,7 @@ jobs:
5251
5352
- name: Install dependencies
5453
if: steps.cache-root-node-mods.outputs.cache-hit != 'true'
55-
run: yarn --frozen-lockfile
54+
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
5655

5756
- name: Run yarn fmt
5857
run: yarn fmt
@@ -74,7 +73,24 @@ jobs:
7473
uses: actions/checkout@v3
7574
with:
7675
fetch-depth: 0
77-
submodules: true
76+
77+
- name: Get submodule hash
78+
id: submodule-hash
79+
run: |
80+
echo "::set-output name=key::$(git ls-tree HEAD lib/vscode)"
81+
82+
- name: Fetch submodule from cache
83+
id: cache-submodule
84+
uses: actions/cache@v3
85+
with:
86+
path: "lib/vscode/**"
87+
key: submodule-hash-${{ steps.submodule-hash.outputs.key }}
88+
restore-keys: |
89+
submodule-hash-
90+
91+
- name: Checkout submodule
92+
if: steps.cache-submodule.outputs.cache-hit != 'true'
93+
run: git submodule update --init
7894

7995
- name: Install quilt
8096
run: sudo apt update && sudo apt install quilt

0 commit comments

Comments
 (0)