Skip to content

Commit 13a289f

Browse files
committed
Cache buildroot (based on @nurikk-sa 's work)
Ref: webosbrew/hyperhdr-webos-loader@b4bf2e4
1 parent a022154 commit 13a289f

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

.github/workflows/build.yml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,22 @@ jobs:
5151
mkdir -p ./${{ env.BUILD_DIR_NATIVE }}
5252
mkdir -p ./${{ env.BUILD_DIR_CROSS }}
5353
54+
- name: Cache toolchain dir
55+
id: cache-toolchain
56+
uses: actions/cache@v3
57+
with:
58+
path: ${{ env.TOOLCHAIN_DIR }}
59+
key: ${{ runner.os }}-${{ env.TOOLCHAIN_URL }}
60+
5461
- name: Download and unpack toolchain
62+
if: steps.cache-toolchain.outputs.cache-hit != 'true'
5563
working-directory: /opt
5664
run: |
5765
wget -q -O toolchain.tar.gz ${TOOLCHAIN_URL}
5866
tar xf toolchain.tar.gz
59-
60-
- name: Relocate toolchain
61-
run: |
6267
pushd ${TOOLCHAIN_DIR}
6368
./relocate-sdk.sh
6469
popd
65-
66-
- name: Fix toolchain (remove perl)
67-
run: |
6870
find ${TOOLCHAIN_DIR}/bin -type f -iname "perl*" -delete
6971
7072
- name: Install native dependencies
@@ -186,17 +188,12 @@ jobs:
186188
with:
187189
node-version: 14.x
188190

189-
- name: Download and unpack toolchain
190-
working-directory: /opt
191-
run: |
192-
wget -q -O toolchain.tar.gz ${TOOLCHAIN_URL}
193-
tar xf toolchain.tar.gz
194-
195-
- name: Relocate toolchain
196-
run: |
197-
pushd ${TOOLCHAIN_DIR}
198-
./relocate-sdk.sh
199-
popd
191+
- name: Restore toolchain cache
192+
id: cache-toolchain
193+
uses: actions/cache@v3
194+
with:
195+
path: ${{ env.TOOLCHAIN_DIR }}
196+
key: ${{ runner.os }}-${{ env.TOOLCHAIN_URL }}
200197

201198
- name: Install native dependencies
202199
env:

0 commit comments

Comments
 (0)