diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index e3d232ad..26e17778 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -23,6 +23,30 @@ jobs: with: node-version: 12.x + - name: Cache Cargo Registry + uses: actions/cache@v1 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }} + + - name: Cache Cargo Build Target + uses: actions/cache@v1 + with: + path: bindings/node/native/target + key: ${{ runner.os }}-cargo-node-build-${{ hashFiles('**/Cargo.toml') }} + + - name: Get NPM cache directory + id: npm-cache + run: | + echo "::set-output name=dir::$(npm config get cache)" + - name: Cache NPM cache + uses: actions/cache@v1 + with: + path: ${{ steps.npm-cache.outputs.dir }} + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Install npm dependencies working-directory: ./bindings/node run: npm ci --ignore-scripts