usage.yml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. name: Package usage
  2. on: [push, pull_request]
  3. jobs:
  4. build:
  5. runs-on: ubuntu-latest
  6. steps:
  7. - uses: actions/checkout@v2
  8. - name: Setup Node.js
  9. uses: actions/setup-node@v1
  10. with:
  11. node-version: 14.x
  12. - name: npm install and build
  13. run: |
  14. npm install
  15. npm run build
  16. - name: Store build-output for later
  17. uses: actions/upload-artifact@v2
  18. with:
  19. name: build-output
  20. path: |
  21. mustache.js
  22. mustache.mjs
  23. package:
  24. runs-on: ubuntu-latest
  25. needs: build
  26. steps:
  27. - uses: actions/checkout@v2
  28. - name: Setup Node.js
  29. uses: actions/setup-node@v1
  30. with:
  31. node-version: 14.x
  32. - name: Get build-output from build step
  33. uses: actions/download-artifact@v2
  34. with:
  35. name: build-output
  36. - name: Create package tarball
  37. run: |
  38. export ARCHIVE_FILENAME=$(npm pack | tail -n 1)
  39. mv $ARCHIVE_FILENAME mustache.tgz
  40. - name: Store package tarball for later
  41. uses: actions/upload-artifact@v2
  42. with:
  43. name: package-output
  44. path: mustache.tgz
  45. common-js-usage:
  46. runs-on: ubuntu-latest
  47. needs: package
  48. steps:
  49. - uses: actions/checkout@v1
  50. - name: Setup Node.js
  51. uses: actions/setup-node@v1
  52. with:
  53. node-version: 12.x
  54. - name: Get package tarball from package step
  55. uses: actions/download-artifact@v2
  56. with:
  57. name: package-output
  58. - name: Package, install and test
  59. run: |
  60. export UNPACK_DESTINATION=$(mktemp -d)
  61. mv mustache.tgz $UNPACK_DESTINATION
  62. cp test/module-systems/commonjs-test.js $UNPACK_DESTINATION
  63. cd $UNPACK_DESTINATION
  64. npm install mustache.tgz
  65. node commonjs-test.js
  66. esm-usage:
  67. runs-on: ubuntu-latest
  68. needs: package
  69. steps:
  70. - uses: actions/checkout@v1
  71. - name: Setup Node.js
  72. uses: actions/setup-node@v1
  73. with:
  74. node-version: '>=13.2.0'
  75. - name: Get package tarball from package step
  76. uses: actions/download-artifact@v2
  77. with:
  78. name: package-output
  79. - name: Package, install and test
  80. run: |
  81. export UNPACK_DESTINATION=$(mktemp -d)
  82. mv mustache.tgz $UNPACK_DESTINATION
  83. cp test/module-systems/esm-test.mjs $UNPACK_DESTINATION
  84. cp test/module-systems/esm-test-exports.mjs $UNPACK_DESTINATION
  85. cd $UNPACK_DESTINATION
  86. npm install mustache.tgz
  87. node esm-test.mjs
  88. node esm-test-exports.mjs
  89. browser-usage:
  90. runs-on: ubuntu-latest
  91. needs: build
  92. steps:
  93. - uses: actions/checkout@v1
  94. - name: Setup Node.js
  95. uses: actions/setup-node@v1
  96. with:
  97. node-version: 12.x
  98. - name: Get build-output from build step
  99. uses: actions/download-artifact@v2
  100. with:
  101. name: build-output
  102. - name: Install and test
  103. run: |
  104. npm ci
  105. npx mocha test/module-systems/browser-test.js
  106. deno-usage:
  107. runs-on: ubuntu-latest
  108. needs: build
  109. steps:
  110. - uses: actions/checkout@v1
  111. - uses: denolib/setup-deno@master
  112. with:
  113. deno-version: 'v1.0.0'
  114. - name: Get build-output from build step
  115. uses: actions/download-artifact@v2
  116. with:
  117. name: build-output
  118. - run: deno --version
  119. - run: deno test --allow-net=deno.land test/module-systems/deno-test.ts