cross-compiles.yml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. ---
  2. name: Cross Compile for 1.1.1
  3. on: [pull_request, push]
  4. permissions:
  5. contents: read
  6. jobs:
  7. cross-compilation:
  8. strategy:
  9. fail-fast: false
  10. matrix:
  11. # The platform matrix specifies:
  12. # arch: the architecture to build for, this defines the tool-chain
  13. # prefix {arch}- and the Debian compiler package gcc-{arch}
  14. # name.
  15. # libs: the Debian package for the necessary link/runtime libraries.
  16. # target: the OpenSSL configuration target to use, this is passed
  17. # directly to the config command line.
  18. # tests: omit this to run all the tests using QEMU, set it to "none"
  19. # to never run the tests, otherwise it's value is passed to
  20. # the "make test" command to allow selectiving disabling of
  21. # tests.
  22. platform: [
  23. {
  24. arch: aarch64-linux-gnu,
  25. libs: libc6-dev-arm64-cross,
  26. target: linux-aarch64
  27. }, {
  28. arch: alpha-linux-gnu,
  29. libs: libc6.1-dev-alpha-cross,
  30. target: linux-alpha-gcc
  31. }, {
  32. arch: arm-linux-gnueabi,
  33. libs: libc6-dev-armel-cross,
  34. target: linux-armv4,
  35. tests: -test_includes -test_store -test_x509_store
  36. }, {
  37. arch: arm-linux-gnueabihf,
  38. libs: libc6-dev-armhf-cross,
  39. target: linux-armv4,
  40. tests: -test_includes -test_store -test_x509_store
  41. }, {
  42. arch: hppa-linux-gnu,
  43. libs: libc6-dev-hppa-cross,
  44. target: -static linux-generic32,
  45. tests: -test_includes -test_store -test_x509_store
  46. }, {
  47. arch: m68k-linux-gnu,
  48. libs: libc6-dev-m68k-cross,
  49. target: -static -m68040 linux-generic32,
  50. tests: -test_includes -test_store -test_x509_store
  51. }, {
  52. arch: mips-linux-gnu,
  53. libs: libc6-dev-mips-cross,
  54. target: -static linux-mips32,
  55. tests: -test_includes -test_store -test_x509_store
  56. }, {
  57. arch: mips64-linux-gnuabi64,
  58. libs: libc6-dev-mips64-cross,
  59. target: -static linux64-mips64,
  60. }, {
  61. arch: mipsel-linux-gnu,
  62. libs: libc6-dev-mipsel-cross,
  63. target: linux-mips32,
  64. tests: -test_includes -test_store -test_x509_store
  65. }, {
  66. arch: powerpc64le-linux-gnu,
  67. libs: libc6-dev-ppc64el-cross,
  68. target: linux-ppc64le
  69. }, {
  70. arch: riscv64-linux-gnu,
  71. libs: libc6-dev-riscv64-cross,
  72. target: linux64-riscv64
  73. }, {
  74. arch: s390x-linux-gnu,
  75. libs: libc6-dev-s390x-cross,
  76. target: linux64-s390x
  77. }, {
  78. arch: sh4-linux-gnu,
  79. libs: libc6-dev-sh4-cross,
  80. target: no-async linux-generic32,
  81. tests: -test_includes -test_store -test_x509_store
  82. },
  83. # These build with shared libraries but they crash when run
  84. # They mirror static builds above in order to cover more of the
  85. # code base.
  86. {
  87. arch: hppa-linux-gnu,
  88. libs: libc6-dev-hppa-cross,
  89. target: linux-generic32,
  90. tests: none
  91. }, {
  92. arch: m68k-linux-gnu,
  93. libs: libc6-dev-m68k-cross,
  94. target: -mcfv4e linux-generic32,
  95. tests: none
  96. }, {
  97. arch: mips-linux-gnu,
  98. libs: libc6-dev-mips-cross,
  99. target: linux-mips32,
  100. tests: none
  101. }, {
  102. arch: mips64-linux-gnuabi64,
  103. libs: libc6-dev-mips64-cross,
  104. target: linux64-mips64,
  105. tests: none
  106. },
  107. # This build doesn't execute either with or without shared libraries.
  108. {
  109. arch: sparc64-linux-gnu,
  110. libs: libc6-dev-sparc64-cross,
  111. target: linux64-sparcv9,
  112. tests: none
  113. }
  114. ]
  115. runs-on: ubuntu-20.04
  116. steps:
  117. - name: install packages
  118. run: |
  119. sudo apt-get update
  120. sudo apt-get -yq --force-yes install \
  121. gcc-${{ matrix.platform.arch }} \
  122. ${{ matrix.platform.libs }}
  123. - uses: actions/checkout@v4
  124. - name: config
  125. run: |
  126. ./Configure --strict-warnings \
  127. --cross-compile-prefix=${{ matrix.platform.arch }}- \
  128. ${{ matrix.platform.target }}
  129. - name: config dump
  130. run: ./configdata.pm --dump
  131. - name: make
  132. run: make -s -j4
  133. - name: install qemu
  134. if: github.event_name == 'push' && matrix.platform.tests != 'none'
  135. run: sudo apt-get -yq --force-yes install qemu-user
  136. - name: make all tests
  137. if: github.event_name == 'push' && matrix.platform.tests == ''
  138. run: |
  139. make test \
  140. QEMU_LD_PREFIX=/usr/${{ matrix.platform.arch }}
  141. - name: make some tests
  142. if: github.event_name == 'push' && matrix.platform.tests != 'none' && matrix.platform.tests != ''
  143. run: |
  144. make test \
  145. TESTS="${{ matrix.platform.tests }}" \
  146. QEMU_LD_PREFIX=/usr/${{ matrix.platform.arch }}