c-cpp.yml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. name: C/C++ CI
  2. on:
  3. push:
  4. branches: [ master ]
  5. pull_request:
  6. jobs:
  7. build-alpine:
  8. timeout-minutes: 15
  9. runs-on: ubuntu-22.04
  10. strategy:
  11. matrix:
  12. config:
  13. - {arch: x86_64, branch: latest-stable}
  14. - {arch: x86, branch: latest-stable}
  15. - {arch: aarch64, branch: latest-stable}
  16. - {arch: armhf, branch: latest-stable}
  17. - {arch: armv7, branch: latest-stable}
  18. - {arch: ppc64le, branch: latest-stable}
  19. - {arch: riscv64, branch: edge}
  20. - {arch: s390x, branch: latest-stable}
  21. steps:
  22. - name: Setup Alpine Linux
  23. uses: jirutka/setup-alpine@v1
  24. with:
  25. arch: ${{ matrix.config.arch }}
  26. branch: ${{ matrix.config.branch }}
  27. - name: Install dependencies
  28. shell: alpine.sh --root {0}
  29. run: |
  30. apk add git cmake gcc g++ make
  31. - name: Checkout repository
  32. uses: actions/checkout@v3
  33. with:
  34. submodules: true
  35. - name: Build RandomX
  36. shell: alpine.sh {0}
  37. run: |
  38. mkdir build
  39. cd build
  40. cmake ..
  41. make -j$(nproc)
  42. - name: Run tests
  43. shell: alpine.sh {0}
  44. run: |
  45. build/randomx-tests
  46. build-ubuntu:
  47. timeout-minutes: 5
  48. runs-on: ${{ matrix.config.os }}
  49. strategy:
  50. matrix:
  51. config:
  52. - {os: ubuntu-20.04, c: gcc-11, cpp: g++-11}
  53. - {os: ubuntu-22.04, c: gcc-12, cpp: g++-12}
  54. steps:
  55. - name: Install dependencies
  56. run: |
  57. sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
  58. sudo apt update
  59. sudo apt install -y git build-essential cmake ${{ matrix.config.c }} ${{ matrix.config.cpp }}
  60. - name: Checkout repository
  61. uses: actions/checkout@v3
  62. with:
  63. submodules: true
  64. - name: Build RandomX
  65. run: |
  66. mkdir build
  67. cd build
  68. cmake ..
  69. make -j$(nproc)
  70. - name: Run tests
  71. run: |
  72. build/randomx-tests
  73. build-windows-msys2:
  74. timeout-minutes: 15
  75. runs-on: windows-latest
  76. strategy:
  77. matrix:
  78. config:
  79. - {c: "gcc", cxx: "g++"}
  80. - {c: "clang", cxx: "clang++"}
  81. defaults:
  82. run:
  83. shell: msys2 {0}
  84. steps:
  85. - name: Checkout repository
  86. uses: actions/checkout@v3
  87. with:
  88. submodules: recursive
  89. - name: Setup MSYS2
  90. uses: eine/setup-msys2@v2
  91. with:
  92. update: true
  93. install: mingw-w64-x86_64-toolchain mingw-w64-x86_64-clang mingw-w64-x86_64-lld mingw-w64-x86_64-cmake make
  94. - name: Build RandomX
  95. run: |
  96. mkdir build
  97. cd build
  98. cmake .. -G "Unix Makefiles" -DCMAKE_C_COMPILER=${{ matrix.config.c }} -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }}
  99. make -j$(nproc)
  100. - name: Run tests
  101. run: |
  102. build/randomx-tests.exe
  103. build-windows-msbuild:
  104. timeout-minutes: 5
  105. runs-on: windows-${{ matrix.config.os }}
  106. strategy:
  107. matrix:
  108. config:
  109. - {arch: x64, os: 2019, vs: Visual Studio 16 2019, msbuild: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin\\amd64\\"}
  110. - {arch: x64, os: 2022, vs: Visual Studio 17 2022, msbuild: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Msbuild\\Current\\Bin\\amd64\\"}
  111. - {arch: Win32, os: 2019, vs: Visual Studio 16 2019, msbuild: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin\\"}
  112. - {arch: Win32, os: 2022, vs: Visual Studio 17 2022, msbuild: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Msbuild\\Current\\Bin\\"}
  113. steps:
  114. - name: Checkout repository
  115. uses: actions/checkout@v3
  116. with:
  117. submodules: recursive
  118. - name: Setup cmake
  119. uses: lukka/get-cmake@latest
  120. - name: Build RandomX
  121. run: |
  122. mkdir build
  123. cd build
  124. cmake .. -G "${{ matrix.config.vs }}" -A ${{ matrix.config.arch }}
  125. & "${{ matrix.config.msbuild }}msbuild" -v:m /m /p:Configuration=Release randomx-tests.vcxproj
  126. - name: Run tests
  127. run: |
  128. build/Release/randomx-tests.exe
  129. build-macos:
  130. timeout-minutes: 5
  131. runs-on: ${{ matrix.os }}
  132. strategy:
  133. matrix:
  134. os: [macos-11, macos-12, macos-13]
  135. steps:
  136. - name: Checkout repository
  137. uses: actions/checkout@v3
  138. with:
  139. submodules: recursive
  140. - name: Install dependencies
  141. run: HOMEBREW_NO_AUTO_UPDATE=1 brew install cmake
  142. - name: Build RandomX
  143. run: |
  144. mkdir build
  145. cd build
  146. cmake ..
  147. make -j3
  148. - name: Run tests
  149. run: |
  150. build/randomx-tests
  151. build-freebsd:
  152. timeout-minutes: 15
  153. runs-on: ${{ matrix.os.host }}
  154. strategy:
  155. matrix:
  156. os:
  157. - name: freebsd
  158. architecture: x86-64
  159. version: '13.2'
  160. host: ubuntu-22.04
  161. - name: freebsd
  162. architecture: arm64
  163. version: '13.2'
  164. host: ubuntu-22.04
  165. steps:
  166. - name: Checkout repository
  167. uses: actions/checkout@v3
  168. with:
  169. submodules: recursive
  170. - name: Build RandomX
  171. uses: cross-platform-actions/action@v0.19.0
  172. with:
  173. operating_system: ${{ matrix.os.name }}
  174. architecture: ${{ matrix.os.architecture }}
  175. version: ${{ matrix.os.version }}
  176. shell: bash
  177. run: |
  178. sudo pkg install -y cmake
  179. mkdir build && cd build
  180. cmake ..
  181. make -j2
  182. ./randomx-tests