ci_ssl.yml 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. name: Nim SSL CI
  2. on:
  3. pull_request:
  4. # Run only on changes on related files
  5. paths:
  6. - 'lib/pure/httpclient.nim'
  7. - 'lib/pure/net.nim'
  8. - 'lib/pure/ssl_certs.nim'
  9. - 'lib/wrappers/openssl.nim'
  10. - 'tests/stdlib/thttpclient_ssl*'
  11. - 'tests/untestable/thttpclient_ssl*'
  12. jobs:
  13. build:
  14. if: |
  15. !contains(format('{0} {1}', github.event.head_commit.message, github.event.pull_request.title), '[skip ci]')
  16. strategy:
  17. fail-fast: false
  18. matrix:
  19. os: [ubuntu-18.04, macos-10.15, windows-2019]
  20. cpu: [amd64]
  21. name: '${{ matrix.os }} (${{ matrix.cpu }})'
  22. runs-on: ${{ matrix.os }}
  23. steps:
  24. - name: 'Checkout'
  25. uses: actions/checkout@v2
  26. - name: 'Checkout csources'
  27. uses: actions/checkout@v2
  28. with:
  29. repository: nim-lang/csources
  30. path: csources
  31. - name: 'Install dependencies (Linux amd64)'
  32. if: runner.os == 'Linux' && matrix.cpu == 'amd64'
  33. run: |
  34. sudo apt-fast update -qq
  35. DEBIAN_FRONTEND='noninteractive' \
  36. sudo apt-fast install --no-install-recommends -y libssl1.1
  37. - name: 'Install dependencies (macOS)'
  38. if: runner.os == 'macOS'
  39. run: brew install make
  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 "::add-path::${{ github.workspace }}/dist/mingw64/bin"
  50. - name: 'Add build binaries to PATH'
  51. shell: bash
  52. run: echo "::add-path::${{ github.workspace }}/bin"
  53. - name: 'Build 1-stage compiler from 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: 'Build the real compiler'
  74. shell: bash
  75. run: ./koch boot
  76. - name: 'Run SSL nimDisableCertificateValidation integration tests'
  77. shell: bash
  78. run: nim c -d:nimDisableCertificateValidation -d:ssl -r -p:. tests/untestable/thttpclient_ssl_disabled.nim
  79. - name: 'Run SSL certificate check integration tests'
  80. # Not supported on Windows due to old openssl version
  81. if: runner.os != 'Windows'
  82. shell: bash
  83. run: nim c -d:ssl -p:. --threads:on -r tests/untestable/thttpclient_ssl.nim