@@ -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