Skip to content

Commit 5e6b6e0

Browse files
authored
Merge pull request #15 from nurikk/build_improvements
Cache buildroot
2 parents 207597d + b4bf2e4 commit 5e6b6e0

File tree

1 file changed

+16
-20
lines changed

1 file changed

+16
-20
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,22 @@ jobs:
4545
- name: Create build directories
4646
run: |
4747
mkdir -p ./${{ env.BUILD_DIR }}
48-
49-
- name: Download and unpack toolchain
48+
- name: Cache toolchain dir
49+
id: cache-toolchain
50+
uses: actions/cache@v3
51+
with:
52+
path: ${{ env.TOOLCHAIN_DIR }}
53+
key: ${{ runner.os }}-${{ env.TOOLCHAIN_URL }}
54+
55+
- name: Download and unpack toolchain
56+
if: steps.cache-toolchain.outputs.cache-hit != 'true'
5057
working-directory: /opt
5158
run: |
5259
wget -q -O toolchain.tar.gz ${TOOLCHAIN_URL}
5360
tar xf toolchain.tar.gz
54-
55-
- name: Relocate toolchain
56-
run: |
5761
pushd ${TOOLCHAIN_DIR}
5862
./relocate-sdk.sh
5963
popd
60-
61-
- name: Fix toolchain (remove perl)
62-
run: |
6364
find ${TOOLCHAIN_DIR}/bin -type f -iname "perl*" -delete
6465
6566
- name: Install native dependencies
@@ -137,18 +138,13 @@ jobs:
137138
uses: actions/setup-node@v1
138139
with:
139140
node-version: 14.x
140-
141-
- name: Download and unpack toolchain
142-
working-directory: /opt
143-
run: |
144-
wget -q -O toolchain.tar.gz ${TOOLCHAIN_URL}
145-
tar xf toolchain.tar.gz
146-
147-
- name: Relocate toolchain
148-
run: |
149-
pushd ${TOOLCHAIN_DIR}
150-
./relocate-sdk.sh
151-
popd
141+
142+
- name: Restore toolchain cache
143+
id: cache-toolchain
144+
uses: actions/cache@v3
145+
with:
146+
path: ${{ env.TOOLCHAIN_DIR }}
147+
key: ${{ runner.os }}-${{ env.TOOLCHAIN_URL }}
152148

153149
- name: Install native dependencies
154150
env:

0 commit comments

Comments
 (0)