main.yml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. name: CI
  2. on:
  3. push:
  4. branches:
  5. - master
  6. - develop
  7. - /^release\/.*$/
  8. pull_request:
  9. branches:
  10. - master
  11. - develop
  12. - /^release\/.*$/
  13. jobs:
  14. Docs:
  15. runs-on: ubuntu-20.04
  16. container: texlive/texlive:latest-medium
  17. steps:
  18. - uses: actions/checkout@v2
  19. - name: generate PDF
  20. run: |
  21. make docs
  22. cp doc/crypt.pdf crypt-${{ github.run_id }}.pdf
  23. - name: upload PDF
  24. uses: actions/upload-artifact@v3
  25. with:
  26. name: crypt-${{ github.run_id }}.pdf
  27. path: crypt-${{ github.run_id }}.pdf
  28. Build:
  29. runs-on: ${{ matrix.os }}
  30. strategy:
  31. matrix:
  32. cc: [ gcc, clang ]
  33. os: [ ubuntu-20.04, ubuntu-22.04 ]
  34. config:
  35. - { BUILDNAME: 'META_BUILDS', BUILDOPTIONS: '-DGMP_DESC', BUILDSCRIPT: '.ci/meta_builds.sh' }
  36. - { BUILDNAME: 'VALGRIND', BUILDOPTIONS: '', BUILDSCRIPT: '.ci/valgrind.sh' }
  37. - { BUILDNAME: 'STOCK', BUILDOPTIONS: '', BUILDSCRIPT: '.ci/run.sh' }
  38. - { BUILDNAME: 'STOCK-MPI', BUILDOPTIONS: '-ULTM_DESC -UTFM_DESC -UUSE_LTM -UUSE_TFM', BUILDSCRIPT: '.ci/run.sh' }
  39. - { BUILDNAME: 'STOCK+AESNI', BUILDOPTIONS: '-msse4.1 -maes', BUILDSCRIPT: '.ci/run.sh' }
  40. - { BUILDNAME: 'EASY', BUILDOPTIONS: '-DLTC_EASY', BUILDSCRIPT: '.ci/run.sh' }
  41. - { BUILDNAME: 'SMALL', BUILDOPTIONS: '-DLTC_SMALL_CODE', BUILDSCRIPT: '.ci/run.sh' }
  42. - { BUILDNAME: 'NO_TABLES', BUILDOPTIONS: '-DLTC_NO_TABLES', BUILDSCRIPT: '.ci/run.sh' }
  43. - { BUILDNAME: 'NO_FAST', BUILDOPTIONS: '-DLTC_NO_FAST', BUILDSCRIPT: '.ci/run.sh' }
  44. - { BUILDNAME: 'NO_FAST+SMALL+NO_TABLES', BUILDOPTIONS: '-DLTC_NO_FAST -DLTC_SMALL_CODE -DLTC_NO_TABLES', BUILDSCRIPT: '.ci/run.sh' }
  45. - { BUILDNAME: 'NO_ASM', BUILDOPTIONS: '-DLTC_NO_ASM', BUILDSCRIPT: '.ci/run.sh' }
  46. - { BUILDNAME: 'NO_TIMING_RESISTANCE', BUILDOPTIONS: '-DLTC_NO_ECC_TIMING_RESISTANT -DLTC_NO_RSA_BLINDING', BUILDSCRIPT: '.ci/run.sh' }
  47. - { BUILDNAME: 'FORTUNA_CUSTOM_OPTIONS', BUILDOPTIONS: '-DLTC_FORTUNA_USE_ENCRYPT_ONLY -DLTC_FORTUNA_RESEED_RATELIMIT_STATIC', BUILDSCRIPT: '.ci/run.sh' }
  48. - { BUILDNAME: 'PTHREAD', BUILDOPTIONS: '-DLTC_PTHREAD', BUILDSCRIPT: '.ci/run.sh' }
  49. - { BUILDNAME: 'STOCK+ARGTYPE=1', BUILDOPTIONS: '-DARGTYPE=1', BUILDSCRIPT: '.ci/run.sh' }
  50. - { BUILDNAME: 'STOCK+ARGTYPE=2', BUILDOPTIONS: '-DARGTYPE=2', BUILDSCRIPT: '.ci/run.sh' }
  51. - { BUILDNAME: 'STOCK+ARGTYPE=3', BUILDOPTIONS: '-DARGTYPE=3', BUILDSCRIPT: '.ci/run.sh' }
  52. - { BUILDNAME: 'STOCK+ARGTYPE=4', BUILDOPTIONS: '-DARGTYPE=4', BUILDSCRIPT: '.ci/run.sh' }
  53. steps:
  54. - uses: actions/checkout@v2
  55. - name: install dependencies
  56. run: |
  57. sudo apt-get update -qq
  58. sudo apt-get install -y libgmp-dev valgrind libtool-bin clang-tools lcov ruby clang
  59. sudo apt-get remove -y libtommath1
  60. sudo gem install coveralls-lcov
  61. curl -s https://packagecloud.io/install/repositories/libtom/packages/script.deb.sh | sudo bash
  62. sudo apt-get install libtfm-git-dev libtommath-git-dev
  63. - name: run tests
  64. env:
  65. CC: "${{ matrix.cc }}"
  66. PR_NUMBER: ${{ github.event.number }}
  67. REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  68. run: |
  69. bash "${{ matrix.config.BUILDSCRIPT }}" "${{ matrix.config.BUILDNAME }}" "-DUSE_LTM -DLTM_DESC" "makefile V=1" "${{ matrix.config.BUILDOPTIONS }}" "-ltommath"
  70. bash "${{ matrix.config.BUILDSCRIPT }}" "${{ matrix.config.BUILDNAME }}" "-DUSE_TFM -DTFM_DESC" "makefile.shared V=1" "${{ matrix.config.BUILDOPTIONS }}" "-ltfm"
  71. - name: regular logs
  72. if: ${{ !failure() }}
  73. run: |
  74. cat gcc_1.txt || true
  75. cat gcc_2.txt || true
  76. - name: error logs
  77. if: ${{ failure() }}
  78. run: |
  79. cat gcc_1.txt || true
  80. cat gcc_2.txt || true
  81. cat test_std.txt || true
  82. cat test_err.txt || true
  83. cat tv.txt || true
  84. - name: pack build directory
  85. if: ${{ failure() }}
  86. run: |
  87. tar cJf build-${{ github.run_id }}.tar.xz --exclude ./build-${{ github.run_id }}.tar.xz .
  88. - name: upload Artifact
  89. if: ${{ failure() }}
  90. uses: actions/upload-artifact@v3
  91. with:
  92. name: build-${{ github.run_id }}.tar.xz
  93. path: build-${{ github.run_id }}.tar.xz
  94. retention-days: 1