windows.yml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. # Copyright 2021-2024 The OpenSSL Project Authors. All Rights Reserved.
  2. #
  3. # Licensed under the Apache License 2.0 (the "License"). You may not use
  4. # this file except in compliance with the License. You can obtain a copy
  5. # in the file LICENSE in the source distribution or at
  6. # https://www.openssl.org/source/license.html
  7. name: Windows GitHub CI
  8. on: [pull_request, push]
  9. permissions:
  10. contents: read
  11. jobs:
  12. shared:
  13. # Run a job for each of the specified target architectures:
  14. strategy:
  15. matrix:
  16. os:
  17. - windows-2019
  18. - windows-2022
  19. platform:
  20. - arch: win64
  21. config: enable-fips
  22. - arch: win32
  23. config: --strict-warnings no-fips
  24. runs-on: ${{ github.server_url == 'https://github.com' && matrix.os || format('{0}-self-hosted', matrix.os) }}
  25. steps:
  26. - uses: actions/checkout@v4
  27. - name: checkout fuzz/corpora submodule
  28. run: git submodule update --init --depth 1 fuzz/corpora
  29. - uses: ilammy/msvc-dev-cmd@v1
  30. with:
  31. arch: ${{ matrix.platform.arch }}
  32. - uses: ilammy/setup-nasm@v1
  33. with:
  34. platform: ${{ matrix.platform.arch }}
  35. - name: prepare the build directory
  36. run: mkdir _build
  37. - name: config
  38. working-directory: _build
  39. run: |
  40. perl ..\Configure --banner=Configured no-makedepend ${{ matrix.platform.config }}
  41. perl configdata.pm --dump
  42. - name: build
  43. working-directory: _build
  44. run: nmake /S
  45. - name: download coreinfo
  46. uses: suisei-cn/actions-download-file@v1.6.0
  47. with:
  48. url: "https://download.sysinternals.com/files/Coreinfo.zip"
  49. target: _build/coreinfo/
  50. - name: get cpu info
  51. working-directory: _build
  52. continue-on-error: true
  53. run: |
  54. 7z.exe x coreinfo/Coreinfo.zip
  55. ./Coreinfo64.exe -accepteula -f
  56. ./apps/openssl.exe version -c
  57. - name: Check platform symbol usage
  58. working-directory: _build
  59. run: perl ../util/checkplatformsyms.pl ../util/platform_symbols/windows-symbols.txt libcrypto-3-x64.dll ./libssl-3-x64.dll
  60. - name: test
  61. working-directory: _build
  62. run: nmake test VERBOSE_FAILURE=yes TESTS=-test_fuzz* HARNESS_JOBS=4
  63. - name: install
  64. # Run on 64 bit only as 32 bit is slow enough already
  65. if: ${{ matrix.platform.arch == 'win64' }}
  66. run: |
  67. mkdir _dest
  68. nmake install DESTDIR=_dest
  69. working-directory: _build
  70. plain:
  71. strategy:
  72. matrix:
  73. os:
  74. - windows-2019
  75. - windows-2022
  76. runs-on: ${{ github.server_url == 'https://github.com' && matrix.os || format('{0}-self-hosted', matrix.os) }}
  77. steps:
  78. - uses: actions/checkout@v4
  79. - name: checkout fuzz/corpora submodule
  80. run: git submodule update --init --depth 1 fuzz/corpora
  81. - uses: ilammy/msvc-dev-cmd@v1
  82. - name: prepare the build directory
  83. run: mkdir _build
  84. - name: config
  85. working-directory: _build
  86. run: |
  87. perl ..\Configure --banner=Configured enable-demos no-makedepend no-shared no-fips enable-md2 enable-rc5 enable-ssl3 enable-ssl3-method enable-weak-ssl-ciphers enable-trace enable-crypto-mdebug VC-WIN64A-masm
  88. perl configdata.pm --dump
  89. - name: build
  90. working-directory: _build
  91. run: nmake /S
  92. - name: download coreinfo
  93. uses: suisei-cn/actions-download-file@v1.6.0
  94. with:
  95. url: "https://download.sysinternals.com/files/Coreinfo.zip"
  96. target: _build/coreinfo/
  97. - name: get cpu info
  98. working-directory: _build
  99. continue-on-error: true
  100. run: |
  101. 7z.exe x coreinfo/Coreinfo.zip
  102. ./Coreinfo64.exe -accepteula -f
  103. ./apps/openssl.exe version -c
  104. - name: test
  105. working-directory: _build
  106. run: nmake test VERBOSE_FAILURE=yes HARNESS_JOBS=4
  107. minimal:
  108. strategy:
  109. matrix:
  110. os:
  111. - windows-2019
  112. - windows-2022
  113. runs-on: ${{ github.server_url == 'https://github.com' && matrix.os || format('{0}-self-hosted', matrix.os) }}
  114. steps:
  115. - uses: actions/checkout@v4
  116. - name: checkout fuzz/corpora submodule
  117. run: git submodule update --init --depth 1 fuzz/corpora
  118. - uses: ilammy/msvc-dev-cmd@v1
  119. - name: prepare the build directory
  120. run: mkdir _build
  121. - name: config
  122. working-directory: _build
  123. run: |
  124. perl ..\Configure --banner=Configured enable-demos no-makedepend no-bulk no-deprecated no-fips no-asm no-threads -DOPENSSL_SMALL_FOOTPRINT
  125. perl configdata.pm --dump
  126. - name: build
  127. working-directory: _build
  128. run: nmake # verbose, so no /S here
  129. - name: download coreinfo
  130. uses: suisei-cn/actions-download-file@v1.6.0
  131. with:
  132. url: "https://download.sysinternals.com/files/Coreinfo.zip"
  133. target: _build/coreinfo/
  134. - name: get cpu info
  135. working-directory: _build
  136. continue-on-error: true
  137. run: |
  138. 7z.exe x coreinfo/Coreinfo.zip
  139. ./Coreinfo64.exe -accepteula -f
  140. ./apps/openssl.exe version -c
  141. - name: test
  142. working-directory: _build
  143. run: nmake test VERBOSE_FAILURE=yes TESTS=-test_fuzz* HARNESS_JOBS=4
  144. cygwin:
  145. # Run a job for each of the specified target architectures:
  146. strategy:
  147. matrix:
  148. os:
  149. - windows-2019
  150. # really worth while running, too? cygwin should mask this
  151. # - windows-2022
  152. platform:
  153. - arch: win64
  154. config: -DCMAKE_C_COMPILER=gcc --strict-warnings enable-demos no-fips
  155. # are we really learning sth new from win32? So let's save some CO2 for now disabling this
  156. # - arch: win32
  157. # config: -DCMAKE_C_COMPILER=gcc --strict-warnings no-fips
  158. runs-on: ${{ github.server_url == 'https://github.com' && matrix.os || format('{0}-self-hosted', matrix.os) }}
  159. env:
  160. CYGWIN_NOWINPATH: 1
  161. SHELLOPTS: igncr
  162. # Don't overwhelm github CI VMs:
  163. MAKE_PARAMS: -j 4
  164. steps:
  165. # Checkout before cygwin can mess with PATH...
  166. - uses: actions/checkout@v4
  167. - uses: cygwin/cygwin-install-action@master
  168. with:
  169. packages: perl git make gcc-core
  170. - name: Check repo
  171. run: cygcheck -V
  172. - name: Full cygcheck status
  173. run: cygcheck -s -v -r -h
  174. # Activate this if checkout action fails:
  175. # - name: Clone repo
  176. # run: bash -c "pwd && git clone --branch ${{ github.ref_name }} --depth 1 https://github.com/${{ github.repository }}.git"
  177. - name: Full build
  178. run: bash -c "gcc --version && ./config ${{ matrix.platform.config }} && make $MAKE_PARAMS"
  179. # Disable testing for now. TBD: Need local cygwin installation to debug .
  180. # - name: Run openssl tests
  181. # run: bash -c "cd openssl && make V=1 test"