compiler-zoo.yml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. # Copyright 2021-2023 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: Compiler Zoo CI
  8. on: [push]
  9. permissions:
  10. contents: read
  11. jobs:
  12. compiler:
  13. strategy:
  14. fail-fast: false
  15. matrix:
  16. zoo: [
  17. {
  18. cc: gcc-7,
  19. distro: ubuntu-20.04
  20. }, {
  21. cc: gcc-8,
  22. distro: ubuntu-20.04
  23. }, {
  24. cc: gcc-9,
  25. distro: ubuntu-20.04
  26. }, {
  27. cc: gcc-10,
  28. distro: ubuntu-20.04
  29. }, {
  30. cc: gcc-11,
  31. distro: ubuntu-22.04
  32. }, {
  33. cc: gcc-12,
  34. distro: ubuntu-22.04
  35. }, {
  36. cc: gcc-13,
  37. distro: ubuntu-22.04,
  38. gcc-ppa-name: ubuntu-toolchain-r/test
  39. }, {
  40. cc: clang-6.0,
  41. distro: ubuntu-20.04
  42. }, {
  43. cc: clang-7,
  44. distro: ubuntu-20.04
  45. }, {
  46. cc: clang-8,
  47. distro: ubuntu-20.04
  48. }, {
  49. cc: clang-9,
  50. distro: ubuntu-20.04
  51. }, {
  52. cc: clang-10,
  53. distro: ubuntu-20.04
  54. }, {
  55. cc: clang-11,
  56. distro: ubuntu-20.04
  57. }, {
  58. cc: clang-12,
  59. distro: ubuntu-20.04
  60. }, {
  61. cc: clang-13,
  62. distro: ubuntu-22.04
  63. }, {
  64. cc: clang-14,
  65. distro: ubuntu-22.04
  66. }, {
  67. cc: clang-15,
  68. distro: ubuntu-22.04,
  69. llvm-ppa-name: jammy
  70. }, {
  71. cc: clang-16,
  72. distro: ubuntu-22.04,
  73. llvm-ppa-name: jammy
  74. }, {
  75. cc: clang-17,
  76. distro: ubuntu-22.04,
  77. llvm-ppa-name: jammy
  78. }
  79. ]
  80. # We set per-compiler now to allow testing with both older and newer sets
  81. # Often, the full range of oldest->newest compilers we want aren't available
  82. # in a single version of Ubuntu.
  83. runs-on: ${{ matrix.zoo.distro }}
  84. steps:
  85. - name: install packages
  86. run: |
  87. gcc_ppa_name="${{ matrix.zoo.gcc-ppa-name }}"
  88. llvm_ppa_name="${{ matrix.zoo.llvm-ppa-name }}"
  89. # In the Matrix above:
  90. # - we set gcc-ppc-name if the GCC version isn't part of the Ubuntu version we're using (see https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test).
  91. # - we set llvm-ppa-name if an LLVM version isn't part of the Ubuntu version we're using (see https://apt.llvm.org/).
  92. # This is especially needed because even new Ubuntu LTSes aren't available
  93. # until a while after release on Github Actions.
  94. if [[ -n ${gcc_ppa_name} ]] ; then
  95. sudo add-apt-repository ppa:ubuntu-toolchain-r/test
  96. sudo apt-get update
  97. elif [[ -n ${llvm_ppa_name} ]] ; then
  98. wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key |\
  99. gpg --dearmor |\
  100. sudo tee /usr/share/keyrings/llvm-snapshot.gpg.key > /dev/null
  101. clang_version="${{ matrix.zoo.cc }}"
  102. clang_version="${clang_version/clang-}"
  103. echo "deb [signed-by=/usr/share/keyrings/llvm-snapshot.gpg.key] http://apt.llvm.org/${{ matrix.zoo.llvm-ppa-name }}/ llvm-toolchain-${{ matrix.zoo.llvm-ppa-name }}-${clang_version} main" \
  104. | sudo tee /etc/apt/sources.list.d/llvm.list
  105. echo "deb-src [signed-by=/usr/share/keyrings/llvm-snapshot.gpg.key] http://apt.llvm.org/${{ matrix.zoo.llvm-ppa-name }}/ llvm-toolchain-${{ matrix.zoo.llvm-ppa-name }}-${clang_version} main" \
  106. | sudo tee -a /etc/apt/sources.list.d/llvm.list
  107. cat /etc/apt/sources.list.d/llvm.list
  108. fi
  109. sudo apt-get update
  110. sudo apt-get -y install ${{ matrix.zoo.cc }}
  111. - uses: actions/checkout@v4
  112. - name: checkout fuzz/corpora submodule
  113. run: git submodule update --init --depth 1 fuzz/corpora
  114. - name: config
  115. run: |
  116. CC=${{ matrix.zoo.cc }} ./config --banner=Configured no-shared \
  117. -Wall -Werror enable-fips --strict-warnings
  118. - name: config dump
  119. run: ./configdata.pm --dump
  120. - name: make
  121. run: make -s -j4
  122. - name: get cpu info
  123. run: |
  124. cat /proc/cpuinfo
  125. ./util/opensslwrap.sh version -c
  126. - name: make test
  127. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}