ci_packages.yml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. name: Packages CI
  2. on: [push, pull_request]
  3. jobs:
  4. build:
  5. # see D20210329T004830
  6. if: |
  7. !contains(format('{0}', github.event.pull_request.title), '[skip ci]')
  8. strategy:
  9. fail-fast: false
  10. matrix:
  11. os: [ubuntu-18.04, macos-10.15]
  12. cpu: [amd64]
  13. batch: ["allowed_failures", "0_3", "1_3", "2_3"] # list of `index_num`
  14. name: '${{ matrix.os }} (batch: ${{ matrix.batch }})'
  15. runs-on: ${{ matrix.os }}
  16. env:
  17. NIM_TEST_PACKAGES: "1"
  18. NIM_TESTAMENT_BATCH: ${{ matrix.batch }}
  19. steps:
  20. - name: 'Checkout'
  21. uses: actions/checkout@v2
  22. with:
  23. fetch-depth: 2
  24. - name: 'Check whether to skip CI'
  25. shell: bash
  26. run: |
  27. # see D20210329T004830
  28. commitMsg=$(git log --no-merges -1 --pretty=format:"%s")
  29. echo commitMsg: $commitMsg
  30. echo $commitMsg | grep -v '\[skip ci\]'
  31. - name: 'Checkout csources'
  32. uses: actions/checkout@v2
  33. with:
  34. repository: nim-lang/csources
  35. path: csources
  36. - name: 'Install node.js 12.x'
  37. uses: actions/setup-node@v1
  38. with:
  39. node-version: '12.x'
  40. - name: 'Install dependencies (Linux amd64)'
  41. if: runner.os == 'Linux' && matrix.cpu == 'amd64'
  42. run: |
  43. sudo apt-fast update -qq
  44. DEBIAN_FRONTEND='noninteractive' \
  45. sudo apt-fast install --no-install-recommends -yq \
  46. libcurl4-openssl-dev libgc-dev libsdl1.2-dev libsfml-dev \
  47. valgrind libc6-dbg libblas-dev xorg-dev
  48. - name: 'Install dependencies (macOS)'
  49. if: runner.os == 'macOS'
  50. run: brew install boehmgc make sfml gtk+3
  51. - name: 'Install dependencies (Windows)'
  52. if: runner.os == 'Windows'
  53. shell: bash
  54. run: |
  55. mkdir dist
  56. curl -L https://nim-lang.org/download/mingw64.7z -o dist/mingw64.7z
  57. curl -L https://nim-lang.org/download/dlls.zip -o dist/dlls.zip
  58. 7z x dist/mingw64.7z -odist
  59. 7z x dist/dlls.zip -obin
  60. echo "${{ github.workspace }}/dist/mingw64/bin" >> "${GITHUB_PATH}"
  61. - name: 'Add build binaries to PATH'
  62. shell: bash
  63. run: echo "${{ github.workspace }}/bin" >> "${GITHUB_PATH}"
  64. - name: 'Build csources'
  65. shell: bash
  66. run: |
  67. ncpu=
  68. case '${{ runner.os }}' in
  69. 'Linux')
  70. ncpu=$(nproc)
  71. ;;
  72. 'macOS')
  73. ncpu=$(sysctl -n hw.ncpu)
  74. ;;
  75. 'Windows')
  76. ncpu=$NUMBER_OF_PROCESSORS
  77. ;;
  78. esac
  79. [[ -z "$ncpu" || $ncpu -le 0 ]] && ncpu=1
  80. make -C csources -j $ncpu CC=gcc ucpu='${{ matrix.cpu }}'
  81. - name: 'Build koch'
  82. shell: bash
  83. run: nim c koch
  84. - name: 'Run CI'
  85. shell: bash
  86. run: ./koch runCI
  87. - name: 'Show failed tests'
  88. if: failure()
  89. shell: bash
  90. run: nim c -r tools/ci_testresults.nim