tests.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. env:
  28. TIMEOUT_EXIT_STATUS: 124
  29. steps:
  30. - uses: actions/checkout@v1
  31. - name: Cache choosenim
  32. id: cache-choosenim
  33. uses: actions/cache@v1
  34. with:
  35. path: ~/.choosenim
  36. key: ${{ runner.os }}-choosenim-${{ matrix.nim_version }}
  37. - name: Cache nimble
  38. id: cache-nimble
  39. uses: actions/cache@v1
  40. with:
  41. path: ~/.nimble
  42. key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }}
  43. - uses: jiro4989/setup-nim-action@v1.0.2
  44. with:
  45. nim-version: ${{ matrix.nim_version }}
  46. - name: Fix apt packages
  47. run: |
  48. # see. https://github.com/actions/virtual-environments/issues/675
  49. sudo sed -i 's/azure\.//' /etc/apt/sources.list
  50. sudo apt update -yqq
  51. - name: Build tests
  52. run: |
  53. cd tests
  54. for file in $(ls -v test*); do
  55. cd $file
  56. echo "test: $file"
  57. nim c -d:ssl main.nim
  58. cd ../
  59. done
  60. shell: bash