選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

141 行
3.6KB

  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. strategy:
  48. matrix:
  49. node-version: [10.x, 12.x, 14.x, 16.x]
  50. needs: package
  51. steps:
  52. - uses: actions/checkout@v1
  53. - name: Setup Node.js
  54. uses: actions/setup-node@v1
  55. with:
  56. node-version: ${{ matrix.node-version }}
  57. - name: Get package tarball from package step
  58. uses: actions/download-artifact@v2
  59. with:
  60. name: package-output
  61. - name: Package, install and test
  62. run: |
  63. export UNPACK_DESTINATION=$(mktemp -d)
  64. mv mustache.tgz $UNPACK_DESTINATION
  65. cp test/module-systems/commonjs-test.js $UNPACK_DESTINATION
  66. cd $UNPACK_DESTINATION
  67. npm install mustache.tgz
  68. node commonjs-test.js
  69. esm-usage:
  70. runs-on: ubuntu-latest
  71. strategy:
  72. matrix:
  73. node-version: [14.x, 16.x]
  74. needs: package
  75. steps:
  76. - uses: actions/checkout@v1
  77. - name: Setup Node.js
  78. uses: actions/setup-node@v1
  79. with:
  80. node-version: ${{ matrix.node-version }}
  81. - name: Get package tarball from package step
  82. uses: actions/download-artifact@v2
  83. with:
  84. name: package-output
  85. - name: Package, install and test
  86. run: |
  87. export UNPACK_DESTINATION=$(mktemp -d)
  88. mv mustache.tgz $UNPACK_DESTINATION
  89. cp test/module-systems/esm-test.mjs $UNPACK_DESTINATION
  90. cp test/module-systems/esm-test-exports.mjs $UNPACK_DESTINATION
  91. cd $UNPACK_DESTINATION
  92. npm install mustache.tgz
  93. node esm-test.mjs
  94. node esm-test-exports.mjs
  95. browser-usage:
  96. runs-on: ubuntu-latest
  97. needs: build
  98. steps:
  99. - uses: actions/checkout@v1
  100. - name: Setup Node.js
  101. uses: actions/setup-node@v1
  102. with:
  103. node-version: 16.x
  104. - name: Get build-output from build step
  105. uses: actions/download-artifact@v2
  106. with:
  107. name: build-output
  108. - name: Install and test
  109. run: |
  110. npm ci
  111. npx mocha test/module-systems/browser-test.js
  112. deno-usage:
  113. runs-on: ubuntu-latest
  114. needs: build
  115. steps:
  116. - uses: actions/checkout@v1
  117. - uses: denolib/setup-deno@master
  118. with:
  119. deno-version: 'v1.0.0'
  120. - name: Get build-output from build step
  121. uses: actions/download-artifact@v2
  122. with:
  123. name: build-output
  124. - run: deno --version
  125. - run: deno test --allow-net=deno.land test/module-systems/deno-test.ts