test.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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-${{ env.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. # FIXME: build failing
  47. # (cd examples/calculator && nim c main.nim)
  48. (cd examples/hello_world && nim c main.nim)
  49. (cd examples/novel && nim c main.nim)
  50. (cd examples/snake && nim c main.nim)
  51. shell: bash