test.yml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. name: test
  2. on:
  3. push:
  4. pull_request:
  5. jobs:
  6. skip:
  7. runs-on: ubuntu-latest
  8. steps:
  9. - run: echo "Skip job"
  10. before:
  11. runs-on: ubuntu-latest
  12. if: "! contains(github.event.head_commit.message, '[skip ci]')"
  13. steps:
  14. - run: echo "not contains '[skip ci]'"
  15. build:
  16. runs-on: ${{ matrix.os }}
  17. strategy:
  18. matrix:
  19. os:
  20. - ubuntu-latest
  21. #- windows-latest
  22. #- macOS-latest
  23. nim_version:
  24. - '1.2.0'
  25. - 'stable'
  26. needs: before
  27. steps:
  28. - uses: actions/checkout@v1
  29. - name: Cache choosenim
  30. id: cache-choosenim
  31. uses: actions/cache@v1
  32. with:
  33. path: ~/.choosenim
  34. key: ${{ runner.os }}-choosenim-${{ matrix.nim_version }}
  35. - name: Cache nimble
  36. id: cache-nimble
  37. uses: actions/cache@v1
  38. with:
  39. path: ~/.nimble
  40. key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }}
  41. - uses: jiro4989/setup-nim-action@v1.0.2
  42. with:
  43. nim-version: ${{ matrix.nim_version }}
  44. - name: Build examples
  45. run: |
  46. (cd examples/hello_world && nim c main.nim)
  47. (cd examples/calculator && nim c main.nim)
  48. (cd examples/novel && nim c main.nim)
  49. (cd examples/snake && nim c main.nim)
  50. shell: bash
  51. - name: Build tests
  52. run: |
  53. (cd tests && nim c test1.nim)
  54. (cd tests && nim c test2.nim)
  55. (cd tests && nim c test3.nim)
  56. (cd tests && nim c test4.nim)
  57. (cd tests && nim c test5.nim)
  58. (cd tests && nim c test6.nim)
  59. (cd tests && nim c test7.nim)
  60. (cd tests && nim c test8.nim)
  61. (cd tests && nim c test9.nim)
  62. (cd tests && nim c test10.nim)
  63. (cd tests && nim c test11.nim)
  64. (cd tests && nim c test12.nim)
  65. (cd tests && nim c test13.nim)
  66. (cd tests && nim c test14.nim)
  67. (cd tests && nim c test15.nim)
  68. (cd tests && nim c test16.nim)
  69. (cd tests && nim c test17.nim)
  70. (cd tests && nim c test18.nim)
  71. (cd tests && nim c test19.nim)
  72. (cd tests && nim c test20.nim)
  73. (cd tests && nim c test21.nim)
  74. (cd tests && nim c test22.nim)
  75. (cd tests && nim c test23.nim)
  76. (cd tests && nim c test24.nim)
  77. shell: bash