ci.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. name: CI
  2. on:
  3. push:
  4. branches:
  5. - master
  6. - v4-dev
  7. pull_request:
  8. branches:
  9. - "**"
  10. env:
  11. FORCE_COLOR: 2
  12. jobs:
  13. run:
  14. runs-on: ${{ matrix.os }}
  15. strategy:
  16. fail-fast: false
  17. matrix:
  18. node:
  19. - "14.x"
  20. - "16.x"
  21. os:
  22. - "ubuntu-latest"
  23. - "macos-latest"
  24. - "windows-latest"
  25. steps:
  26. - name: Clone repository
  27. uses: actions/checkout@v2
  28. - name: Use Node.js ${{ matrix.node }}
  29. uses: actions/setup-node@v2
  30. with:
  31. node-version: ${{ matrix.node }}
  32. - name: Get npm cache directory
  33. id: npm-cache
  34. run: |
  35. echo "::set-output name=dir::$(npm config get cache)"
  36. - name: Set up npm cache
  37. uses: actions/cache@v2
  38. with:
  39. path: ${{ steps.npm-cache.outputs.dir }}
  40. key: ${{ runner.os }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}}
  41. restore-keys: |
  42. ${{ runner.os }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
  43. ${{ runner.os }}-node-v${{ matrix.node }}-
  44. - name: Install npm dependencies
  45. run: npm ci
  46. - name: Build files
  47. run: npm run compile
  48. - name: Run bundlewatch
  49. run: npm run bundlewatch
  50. if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.node, '16')
  51. env:
  52. BUNDLEWATCH_GITHUB_TOKEN: "${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}"