test.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. name: Build and Test
  2. on:
  3. pull_request:
  4. push:
  5. branches:
  6. - master
  7. - releases/*
  8. jobs:
  9. build:
  10. runs-on: ubuntu-latest
  11. steps:
  12. - uses: actions/checkout@v1 # todo: switch to v2
  13. - run: npm ci
  14. - run: npm run build
  15. - run: npm run format-check
  16. - run: npm run lint
  17. - run: npm run pack
  18. - run: npm run gendocs
  19. - name: Verify no unstaged changes
  20. run: __test__/verify-no-unstaged-changes.sh
  21. test:
  22. strategy:
  23. matrix:
  24. runs-on: [ubuntu-latest, macos-latest, windows-latest]
  25. runs-on: ${{ matrix.runs-on }}
  26. steps:
  27. # Clone this repo
  28. - name: Checkout
  29. uses: actions/checkout@v2-beta
  30. # Basic checkout
  31. - name: Basic checkout
  32. uses: ./
  33. with:
  34. ref: test-data/v2/basic
  35. path: basic
  36. - name: Verify basic
  37. shell: bash
  38. run: __test__/verify-basic.sh
  39. # Clean
  40. - name: Modify work tree
  41. shell: bash
  42. run: __test__/modify-work-tree.sh
  43. - name: Clean checkout
  44. uses: ./
  45. with:
  46. ref: test-data/v2/basic
  47. path: basic
  48. - name: Verify clean
  49. shell: bash
  50. run: __test__/verify-clean.sh
  51. # Side by side
  52. - name: Side by side checkout 1
  53. uses: ./
  54. with:
  55. ref: test-data/v2/side-by-side-1
  56. path: side-by-side-1
  57. - name: Side by side checkout 2
  58. uses: ./
  59. with:
  60. ref: test-data/v2/side-by-side-2
  61. path: side-by-side-2
  62. - name: Verify side by side
  63. shell: bash
  64. run: __test__/verify-side-by-side.sh
  65. # LFS
  66. - name: LFS checkout
  67. uses: ./
  68. with:
  69. repository: actions/checkout # hardcoded, otherwise doesn't work from a fork
  70. ref: test-data/v2/lfs
  71. path: lfs
  72. lfs: true
  73. - name: Verify LFS
  74. shell: bash
  75. run: __test__/verify-lfs.sh
  76. test-job-container:
  77. runs-on: ubuntu-latest
  78. container: pstauffer/curl:latest
  79. steps:
  80. # Clone this repo
  81. # todo: after v2-beta contains the latest changes, switch this to "uses: actions/checkout@v2-beta". Also check if can switch to "alpine:latest"
  82. - name: Checkout
  83. run: |
  84. curl --location --user token:${{ github.token }} --output checkout.tar.gz https://api.github.com/repos/actions/checkout/tarball/${{ github.sha }}
  85. tar -xzf checkout.tar.gz
  86. mv */* ./
  87. # Basic checkout
  88. - name: Basic checkout
  89. uses: ./
  90. with:
  91. ref: test-data/v2/basic
  92. path: basic
  93. - name: Verify basic
  94. run: __test__/verify-basic.sh container