message: cache slow steps
diff: @@ -9,17 +9,27 @@ on:
  jobs:
  test:
  runs-on: ubuntu-latest
  +
  strategy:
  matrix:
  node-version: [8.x, 10.x, 12.x]
  +
  steps:
  - name: Install Deps
  run: sudo apt-get install libudev-dev
  +
  - name: Checkout Openzwave
  uses: actions/checkout@v2
  with:
  repository: OpenZWave/open-zwave
  path: open-zwave
  +
  + - name: Cache openzwave
  + uses: actions/cache@v1
  + with:
  + path: open-zwave
  + key: ${{ hashFiles('open-zwave/.git/refs/heads/master') }}
  +
  - name: Install Openzwave
  run: |
  mv open-zwave /tmp
  @@ -35,12 +45,34 @@ jobs:
  with:
  node-version: ${{ matrix.node-version }}
  - - name: Install - Build - Lint - Test
  - run: |
  - npm install
  - npm run lint
  - npm run build
  - npm run test
  + - name: Cache node modules
  + id: cache-node-modules
  + uses: actions/cache@v1
  + with:
  + path: node_modules
  + key: ${{ matrix['node-version'] }}-npm-${{ hashFiles('package-lock.json') }}
  +
  + - name: NPM Install
  + if: steps.cache-node-modules.outputs.cache-hit != 'true'
  + run: npm install
  +
  + - name: NPM Lint
  + if: matrix['node-version'] == '12.x'
  + run: npm run lint
  +
  + - name: Cache build
  + id: cache-build
  + uses: actions/cache@v1
  + with:
  + path: dist
  + key: ${{ matrix['node-version'] }}-cache-build-${{ hashFiles('build/*') }}-${{ hashFiles('src/*') }}-${{ hashFiles('static/*') }}-${{ hashFiles('package-lock.json') }}
  +
  + - name: Build
  + if: steps.cache-build.outputs.cache-hit != 'true'
  + run: npm run build
  +
  + - name: Test
  + run: npm run test
  - name: Generate coverage report
  if: matrix['node-version'] == '12.x'
  @@ -53,3 +85,7 @@ jobs:
  if: matrix['node-version'] == '12.x'
  with:
  github-token: ${{ secrets.github_token }}
  +
  + - name: move ozw back for caching
  + run: |
  + mv /tmp/open-zwave ./
  