ci_packages.yml 2.5 KB

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