main.yml 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. name: CI
  2. on:
  3. push:
  4. branches:
  5. - master
  6. - develop
  7. - 'release/**'
  8. - 'support/**'
  9. - 'ci/**'
  10. pull_request:
  11. branches:
  12. - master
  13. - develop
  14. - 'release/**'
  15. - 'support/**'
  16. - 'ci/**'
  17. concurrency:
  18. group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  19. cancel-in-progress: true
  20. jobs:
  21. Docs:
  22. runs-on: ubuntu-24.04
  23. container: texlive/texlive:latest-medium
  24. steps:
  25. - uses: actions/checkout@v4
  26. - name: generate PDF
  27. run: |
  28. make docs
  29. cp doc/crypt.pdf crypt-${{ github.run_id }}.pdf
  30. - name: upload PDF
  31. uses: actions/upload-artifact@v4
  32. with:
  33. name: crypt-${{ github.run_id }}.pdf
  34. path: crypt-${{ github.run_id }}.pdf
  35. Build:
  36. runs-on: ${{ matrix.os }}
  37. strategy:
  38. matrix:
  39. cc: [ gcc, clang ]
  40. os: [ ubuntu-22.04, ubuntu-24.04 ]
  41. config:
  42. - { BUILDNAME: 'META_BUILDS', BUILDOPTIONS: '-DGMP_DESC', BUILDSCRIPT: '.ci/meta_builds.sh' }
  43. - { BUILDNAME: 'VALGRIND', BUILDOPTIONS: '', BUILDSCRIPT: '.ci/valgrind.sh' }
  44. - { BUILDNAME: 'STOCK', BUILDOPTIONS: '', BUILDSCRIPT: '.ci/run.sh' }
  45. - { BUILDNAME: 'STOCK-MPI', BUILDOPTIONS: '-ULTM_DESC -UTFM_DESC -UUSE_LTM -UUSE_TFM', BUILDSCRIPT: '.ci/run.sh' }
  46. - { BUILDNAME: 'STOCK+AESNI', BUILDOPTIONS: '-DLTC_AES_NI', BUILDSCRIPT: '.ci/run.sh' }
  47. - { BUILDNAME: 'EASY', BUILDOPTIONS: '-DLTC_EASY', BUILDSCRIPT: '.ci/run.sh' }
  48. - { BUILDNAME: 'SMALL', BUILDOPTIONS: '-DLTC_SMALL_CODE', BUILDSCRIPT: '.ci/run.sh' }
  49. - { BUILDNAME: 'NO_TABLES', BUILDOPTIONS: '-DLTC_NO_TABLES', BUILDSCRIPT: '.ci/run.sh' }
  50. - { BUILDNAME: 'NO_FAST', BUILDOPTIONS: '-DLTC_NO_FAST', BUILDSCRIPT: '.ci/run.sh' }
  51. - { BUILDNAME: 'NO_FAST+SMALL+NO_TABLES', BUILDOPTIONS: '-DLTC_NO_FAST -DLTC_SMALL_CODE -DLTC_NO_TABLES', BUILDSCRIPT: '.ci/run.sh' }
  52. - { BUILDNAME: 'NO_ASM', BUILDOPTIONS: '-DLTC_NO_ASM', BUILDSCRIPT: '.ci/run.sh' }
  53. - { BUILDNAME: 'NO_TIMING_RESISTANCE', BUILDOPTIONS: '-DLTC_NO_ECC_TIMING_RESISTANT -DLTC_NO_RSA_BLINDING', BUILDSCRIPT: '.ci/run.sh' }
  54. - { BUILDNAME: 'FORTUNA_CUSTOM_OPTIONS', BUILDOPTIONS: '-DLTC_FORTUNA_USE_ENCRYPT_ONLY -DLTC_FORTUNA_RESEED_RATELIMIT_STATIC', BUILDSCRIPT: '.ci/run.sh' }
  55. - { BUILDNAME: 'PTHREAD', BUILDOPTIONS: '-DLTC_PTHREAD', BUILDSCRIPT: '.ci/run.sh' }
  56. - { BUILDNAME: 'STOCK+ARGTYPE=1', BUILDOPTIONS: '-DARGTYPE=1', BUILDSCRIPT: '.ci/run.sh' }
  57. - { BUILDNAME: 'STOCK+ARGTYPE=2', BUILDOPTIONS: '-DARGTYPE=2', BUILDSCRIPT: '.ci/run.sh' }
  58. - { BUILDNAME: 'STOCK+ARGTYPE=3', BUILDOPTIONS: '-DARGTYPE=3', BUILDSCRIPT: '.ci/run.sh' }
  59. - { BUILDNAME: 'STOCK+ARGTYPE=4', BUILDOPTIONS: '-DARGTYPE=4', BUILDSCRIPT: '.ci/run.sh' }
  60. steps:
  61. - uses: actions/checkout@v4
  62. - name: install dependencies
  63. uses: nick-fields/retry@v3
  64. with:
  65. timeout_minutes: 20
  66. max_attempts: 3
  67. retry_on: error
  68. command: |
  69. sudo apt-get update -qq
  70. sudo apt-get install -y libgmp-dev valgrind libtool-bin clang-tools lcov ruby clang
  71. sudo apt-get remove -y libtommath1
  72. sudo gem install coveralls-lcov
  73. curl -s https://packagecloud.io/install/repositories/libtom/packages/script.deb.sh | sudo bash
  74. sudo apt-get install libtfm-git-dev libtommath-git-dev
  75. - name: run tests
  76. env:
  77. CC: "${{ matrix.cc }}"
  78. PR_NUMBER: ${{ github.event.number }}
  79. REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  80. run: |
  81. bash "${{ matrix.config.BUILDSCRIPT }}" "${{ matrix.config.BUILDNAME }}" "-DUSE_LTM -DLTM_DESC" "makefile V=1" "${{ matrix.config.BUILDOPTIONS }}" "-ltommath"
  82. bash "${{ matrix.config.BUILDSCRIPT }}" "${{ matrix.config.BUILDNAME }}" "-DUSE_TFM -DTFM_DESC" "makefile.shared V=1" "${{ matrix.config.BUILDOPTIONS }}" "-ltfm"
  83. - name: regular logs
  84. if: ${{ !failure() }}
  85. run: |
  86. cat gcc_1.txt || true
  87. cat gcc_2.txt || true
  88. - name: error logs
  89. if: ${{ failure() }}
  90. run: |
  91. cat gcc_1.txt || true
  92. cat gcc_2.txt || true
  93. cat test_std.txt || true
  94. cat test_err.txt || true
  95. cat tv.txt || true
  96. - name: pack build directory
  97. if: ${{ failure() }}
  98. run: |
  99. tar cJf build-${{ github.run_id }}.tar.xz --exclude ./build-${{ github.run_id }}.tar.xz .
  100. - name: upload Artifact
  101. if: ${{ failure() }}
  102. uses: actions/upload-artifact@v4
  103. with:
  104. name: build-${{ github.run_id }}.tar.xz
  105. path: build-${{ github.run_id }}.tar.xz
  106. retention-days: 1
  107. Amalgam:
  108. runs-on: ${{ matrix.os }}
  109. strategy:
  110. matrix:
  111. cc: [ gcc, clang ]
  112. os: [ ubuntu-22.04, ubuntu-24.04 ]
  113. steps:
  114. - uses: actions/checkout@v4
  115. - name: install dependencies
  116. uses: nick-fields/retry@v3
  117. with:
  118. timeout_minutes: 5
  119. max_attempts: 3
  120. retry_on: error
  121. command: |
  122. sudo apt-get update -qq
  123. sudo apt-get remove -y libtommath1
  124. curl -s https://packagecloud.io/install/repositories/libtom/packages/script.deb.sh | sudo bash
  125. sudo apt-get install libtommath-git-dev
  126. - name: run tests
  127. env:
  128. CC: "${{ matrix.cc }}"
  129. run: |
  130. make pre_gen
  131. make CFLAGS="-DLTM_DESC -DUSE_LTM" EXTRALIBS="-ltommath" AMALGAM=1 -j$(nproc) check