compiler-zoo.yml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. # Copyright 2021-2022 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. ]
  76. # We set per-compiler now to allow testing with both older and newer sets
  77. # Often, the full range of oldest->newest compilers we want aren't available
  78. # in a single version of Ubuntu.
  79. runs-on: ${{ matrix.zoo.distro }}
  80. steps:
  81. - name: install packages
  82. run: |
  83. gcc_ppa_name="${{ matrix.zoo.gcc-ppa-name }}"
  84. llvm_ppa_name="${{ matrix.zoo.llvm-ppa-name }}"
  85. # In the Matrix above:
  86. # - 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).
  87. # - we set llvm-ppa-name if an LLVM version isn't part of the Ubuntu version we're using (see https://apt.llvm.org/).
  88. # This is especially needed because even new Ubuntu LTSes aren't available
  89. # until a while after release on Github Actions.
  90. if [[ -n ${gcc_ppa_name} ]] ; then
  91. sudo add-apt-repository ppa:ubuntu-toolchain-r/test
  92. sudo apt-get update
  93. elif [[ -n ${llvm_ppa_name} ]] ; then
  94. wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key |\
  95. gpg --dearmor |\
  96. sudo tee /usr/share/keyrings/llvm-snapshot.gpg.key > /dev/null
  97. clang_version="${{ matrix.zoo.cc }}"
  98. clang_version="${clang_version/clang-}"
  99. 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" \
  100. | sudo tee /etc/apt/sources.list.d/llvm.list
  101. 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" \
  102. | sudo tee -a /etc/apt/sources.list.d/llvm.list
  103. cat /etc/apt/sources.list.d/llvm.list
  104. fi
  105. sudo apt-get update
  106. sudo apt-get -y install ${{ matrix.zoo.cc }}
  107. - uses: actions/checkout@v3
  108. - name: checkout fuzz/corpora submodule
  109. run: git submodule update --init --depth 1 fuzz/corpora
  110. - name: config
  111. run: |
  112. CC=${{ matrix.zoo.cc }} ./config --banner=Configured no-shared \
  113. -Wall -Werror enable-fips --strict-warnings
  114. - name: config dump
  115. run: ./configdata.pm --dump
  116. - name: make
  117. run: make -s -j4
  118. - name: make test
  119. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}